Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Reproducible on current main branch:
fromdataclassesimportdataclassfromtypingimportTypedDict@dataclassclassFoo(TypedDict):bar:int
Traceback:
Traceback (mostrecentcalllast):File"/home/eclips4/projects/test.py",line6,in<module> @dataclass^^^^^^^^^File"/usr/local/lib/python3.12/dataclasses.py",line1237,indataclassreturnwrap(cls)^^^^^^^^^File"/usr/local/lib/python3.12/dataclasses.py",line1227,inwrapreturn_process_class(cls,init,repr,eq,order,unsafe_hash,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/usr/local/lib/python3.12/dataclasses.py",line1113,in_process_classstr(inspect.signature(cls)).replace(' -> None',''))^^^^^^^^^^^^^^^^^^^^^^File"/usr/local/lib/python3.12/inspect.py",line3252,insignaturereturnSignature.from_callable(obj,follow_wrapped=follow_wrapped,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/usr/local/lib/python3.12/inspect.py",line2996,infrom_callablereturn_signature_from_callable(obj,sigcls=cls,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/usr/local/lib/python3.12/inspect.py",line2503,in_signature_from_callablesig=_get_signature_of(call)^^^^^^^^^^^^^^^^^^^^^^^File"/usr/local/lib/python3.12/inspect.py",line2556,in_signature_from_callableraiseValueError(ValueError:nosignaturefoundforbuiltintype<class'dict'>
However, this code works on 3.8 version (but of course we cannot instantiate aTest class)
Maybe we need to add a some check in sources ofdataclass.
Also, this error is not critical, so, feel free to "close as not planned" =)