You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not able to solve until #2869 solved.
dataclasses module calls inspect._signature_from_callable and it compares __new__ built-in method.
Though empty class doesn't have additional __new__ method definition but RustPython implementation always bind new bound method for each types.
Sadly, though #2869 was resolved, it doesn't work because there #2410 is not resolved 😿
Welcome to the magnificent Rust Python 0.1.2 interpreter 😱 🖖
>>>>> import dataclasses
>>>>> @dataclasses.dataclass
..... class A:
..... s: str
.....
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/dataclasses.py", line 1000, in dataclass
return wrap(cls)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/dataclasses.py", line 992, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/dataclasses.py", line 972, in _process_class
str(inspect.signature(cls)).replace(' -> None', ''))
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/inspect.py", line 3093, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/inspect.py", line 2843, in from_callable
follow_wrapper_chains=follow_wrapped)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/inspect.py", line 2370, in _signature_from_callable
return sigcls.from_callable(object)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/inspect.py", line 2843, in from_callable
follow_wrapper_chains=follow_wrapped)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/inspect.py", line 2297, in _signature_from_callable
skip_bound_arg=skip_bound_arg)
File "/home/moreal/github/RustPython/RustPython/vm/pylib-crate/Lib/inspect.py", line 2107, in _signature_from_builtin
raise ValueError("no signature found for builtin {!r}".format(func))
ValueError: no signature found for builtin <class 'object'>
>>>>>
Though #2917 and #2918 seem resolved by #2633 and #2924, a new bug which <KEY> in <TYPE>.__dict__ try to find <KEY> even the base types. I'm trying to fix the bug through #2932.
Activity
moreal commentedon Aug 12, 2021
This issue is not able to solve until #2869 solved.
dataclassesmodule callsinspect._signature_from_callableand it compares__new__built-in method.Though empty class doesn't have additional
__new__method definition but RustPython implementation always bind new bound method for each types.References
RustPython/vm/src/pyobject.rs
Lines 391 to 397 in 8cf3506
https://github.com/python/cpython/blob/fa919fdf2583bdfead1df00e842f24f30b2a34bf/Lib/inspect.py#L2367-L2368:
moreal commentedon Aug 14, 2021
Sadly, though #2869 was resolved, it doesn't work because there #2410 is not resolved 😿
moreal commentedon Aug 20, 2021
Though #2410 was resolved by #2904, the new bug #2917, #2918 appeared. I started to work on them.
moreal commentedon Aug 22, 2021
Though #2917 and #2918 seem resolved by #2633 and #2924, a new bug which
<KEY> in <TYPE>.__dict__try to find<KEY>even the base types. I'm trying to fix the bug through #2932.oroppas commentedon Sep 7, 2021
It appears 2c34602 add enough
dataclassessupport such that we can run basic richThis is really awesome! Thank you.
Snowapril commentedon Sep 7, 2021
Cool! 😊