Open brianschubert opened 1 week ago
stubdefaulter misses replacements on __init__ methods of C extension classes.
__init__
For example: python/typeshed#12797 and python/typeshed#12798
It looks like this may be related having signature(cls) != signature(cls.__init__) at runtime:
signature(cls) != signature(cls.__init__)
>>> import inspect, pickle >>> pickle.Pickler <class '_pickle.Pickler'> # backed by _pickle C extension module >>> inspect.signature(pickle.Pickler) <Signature (file, protocol=None, fix_imports=True, buffer_callback=None)> >>> inspect.signature(pickle.Pickler.__init__) <Signature (self, /, *args, **kwargs)>
This also affects replacements for __new__ based on python/typeshed#12796
__new__
Maybe stubdefaulter should look for a signature on the class when the one on __init__ or __new__ is not informative.
stubdefaulter misses replacements on
__init__
methods of C extension classes.For example: python/typeshed#12797 and python/typeshed#12798
It looks like this may be related having
signature(cls) != signature(cls.__init__)
at runtime: