Feature
The whats_left.sh script generates a list of incompatibilities by comparing signatures with inspect.signature(). I think one source of mismatches is because of how builtin object inherit (or don't inherit) from object. I don't yet understand how RustPython is doing this so I'm documenting the issue here, but I could write a PR with some help.
Description
As an example: sys.__loader__ is listed by whats_left because signature() returns a ValueError. The CPython signature is (), which is the default signature of object.
In both CPython and RustPython inspect.signature is calling inspect._signature_from_callable() (code), which eventually gets to this block.
The class is an instance of _frozen_importlib.BuiltinImporter which has no __init__ or __new__ method defined. In CPython, both of those methods are the same as the object methods (using the is test, e.g. the same memory address). In RustPython the __new__ method is different. I would guess that something about the class definition is creating a separate __new__ method even though there shouldn't be one.
Feature
The
whats_left.shscript generates a list of incompatibilities by comparing signatures withinspect.signature(). I think one source of mismatches is because of how builtin object inherit (or don't inherit) fromobject. I don't yet understand how RustPython is doing this so I'm documenting the issue here, but I could write a PR with some help.Description
As an example:
sys.__loader__is listed bywhats_leftbecausesignature()returns a ValueError. The CPython signature is(), which is the default signature ofobject.In both CPython and RustPython
inspect.signatureis callinginspect._signature_from_callable()(code), which eventually gets to this block.The class is an instance of
_frozen_importlib.BuiltinImporterwhich has no__init__or__new__method defined. In CPython, both of those methods are the same as theobjectmethods (using theistest, e.g. the same memory address). In RustPython the__new__method is different. I would guess that something about the class definition is creating a separate__new__method even though there shouldn't be one.