-
Notifications
You must be signed in to change notification settings - Fork 274
Closed
Labels
topic: featureDiscussions about new features for Python's type annotationsDiscussions about new features for Python's type annotations
Description
When #136 will be fixed, it will be nice to have something that could be used in place of issubclass for "experimentation" with types. Mypy already provides such a function -- reveal_type. I think it works very well and maybe it is a good idea to add a recommendation to PEP 484 that static type checkers should provide a function to reveal the inferred types? Or maybe even add a function
def reveal_type(obj):
print('Runtime type is:', getattr(obj, '__orig_class__', type(obj)))
return objto typing.py so that it can be used for this purpose by other type checkers.
Metadata
Metadata
Assignees
Labels
topic: featureDiscussions about new features for Python's type annotationsDiscussions about new features for Python's type annotations