This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author FFY00
Recipients FFY00, wlf100220
Date 2020-12-11.21:48:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607723297.4.0.40140264274.issue42610@roundup.psfhosted.org>
In-reply-to
Content
There is type() to get the runtime type.

https://docs.python.org/3/library/functions.html#type

```python
>>> foo = 1
>>> type(foo)
<class 'int'>
```

Keep in mind that in Python using type hints does not enforce anything at runtime. You can say `foo: int = 1` but `int` there is just some extra information for type checkers, like mypy, to use.

If you want the type hints, you can use typing.get_type_hints() but this is only available for modules, classes or functions, not variables.
History
Date User Action Args
2020-12-11 21:48:17FFY00setrecipients: + FFY00, wlf100220
2020-12-11 21:48:17FFY00setmessageid: <1607723297.4.0.40140264274.issue42610@roundup.psfhosted.org>
2020-12-11 21:48:17FFY00linkissue42610 messages
2020-12-11 21:48:17FFY00create