What is a type? #923
-
In Python how do you tell if an object is a type? Are types well defined? Is an instance of |
Beta Was this translation helpful? Give feedback.
Answered by
JelleZijlstra
Nov 5, 2021
Replies: 1 comment 1 reply
-
"Type" can have two different plausible meanings:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hauntsaninja
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Type" can have two different plausible meanings:
int
. At runtime you can check for these withisinstance(obj, type)
. In the type system they are represented as e.g.type[int]
(orType[int]
in older versions). An instance of TypeVar is not a type in this definition.