Filipe Laíns <la...@riseup.net> added the comment:

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.

----------
nosy: +FFY00

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42610>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to