| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
… inspect.signature() The ``__module__`` attribute is missing for instance methods in extension modules, so instead we use in this case ``__objclass__.__module__``.
|
Alternatively, we could set the __module__ attribute for instance methods, see #115232. Right now for built-in instance methods its missing (c.f. pure-python classes): >>> int.to_bytes.__module__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'method_descriptor' object has no attribute '__module__'. Did you mean: '__reduce__'? |
Sorry, something went wrong.
|
@serhiy-storchaka, I hope I did requested changes. |
Sorry, something went wrong.
…S6w7.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
…sion modules (pythonGH-115270) Now inspect.signature() supports references to the module globals in parameter defaults on methods in extension modules. Previously it was only supported in functions. The workaround was to specify the fully qualified name, including the module name.
| Back | FazBrowse Home | New Git URL |
The __module__ attribute is missing for instance methods in extension modules, so instead we use in this case __objclass__.__module__.