Message366580
Whether this is considered a bug or not is subjective. The question is should callable(Tuple) return True or False? Or should it for any other annotation object?
The reason it returns true in the first place is because of a warning to explicitly NOT call them as functions/constructors:
>>> from typing import Tuple
>>> callable(Tuple)
True
>>> Tuple()
TypeError: Type Tuple cannot be instantiated; use tuple() instead
Source code: https://github.com/python/cpython/blob/master/Lib/typing.py#L724:L733
I honestly don't know how this could be "fixed" if it even needs to be fixed. But I just wanted to bring attention to it.
Cheers. |
|
Date |
User |
Action |
Args |
2020-04-16 07:27:17 | Noah May | set | recipients:
+ Noah May |
2020-04-16 07:27:17 | Noah May | set | messageid: <1587022037.69.0.998051306567.issue40298@roundup.psfhosted.org> |
2020-04-16 07:27:17 | Noah May | link | issue40298 messages |
2020-04-16 07:27:17 | Noah May | create | |
|