GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — bpo-43682: @staticmethod inherits attributes by vstinner · Pull Request #25268 · python/cpython Conversation
|
|
functools_wraps() call in cm_init() failed because Python didn't initialize PyClassMethod_Type type at startup. I created https://bugs.python.org/issue43770 to fix the issue: it's now fixed by df5dc1c |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I chose the following representation: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Static methods (@staticmethod) and class methods (@classmethod) now inherit the method attributes (__module__, __name__, __qualname__, __doc__, __annotations__) and have a new __wrapped__ attribute. Changes: * Add a repr() method to staticmethod and classmethod types. * Add tests on the @classmethod decorator.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ethod` These attributes have all been added in Python 3.10+; see python/cpython#25268
|
@vstinner What’s this new |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It's a standard attribute added by |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@carljm Thanks, so I guess in this case it’s a documented duplicate of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| PyObject *value = PyObject_GetAttr(wrapped, name); | ||
| if (value == NULL) { | ||
| if (PyErr_ExceptionMatches(PyExc_AttributeError)) { | ||
| PyErr_Clear(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is better to use _PyObject_LookupAttr() here. See #106303.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.