| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It is a new name of former _PyObject_LookupAttr().
There was a problem hiding this comment.
To ease the review, you might keep the old name with an alias #define _PyObject_LookupAttr PyObject_GetOptionalAttr, and then write a second PR to update usage of the old name. (Well, just split the PR in two parts.)
Sorry, something went wrong.
|
|
||
|
|
||
| .. c:function:: int PyObject_GetOptionalAttrString(PyObject *obj, const char *attr_name, PyObject **result); | ||
|
|
There was a problem hiding this comment.
You may just say:
Similar to :c:func:`PyObject_GetOptionalAttr`, but *name* is a UTF-8 encoded string.
To not copy/paste the documentation.
Sorry, something went wrong.
There was a problem hiding this comment.
In all other functions with String suffix the documentation is repeated. If we are going to change this, it should be changed for all function at once.
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
There was a problem hiding this comment.
LGTM. Thanks for the update.
Sorry, something went wrong.
Sorry, something went wrong.
`_PyObject_LookupAttrId` was removed / replaced with `PyObject_GetOptionalAttrString` in python/cpython#106522. https://docs.python.org/dev/c-api/object.html#c.PyObject_GetOptionalAttrString Fixes ```cpp /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h: In function ‘update_bases’: (diff) /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h:51:13: error: implicit declaration of function ‘_PyObject_LookupAttrId’; did you mean ‘_PyObject_GetAttrId’? [-Werror=implicit-function-declaration] (diff) 51 | if (_PyObject_LookupAttrId(base, &PyId___mro_entries__, &meth) < 0) { (diff) | ^~~~~~~~~~~~~~~~~~~~~~ (diff) | _PyObject_GetAttrId (diff) ```
| Back | FazBrowse Home | New Git URL |
It is a new name of former _PyObject_LookupAttr().
📚 Documentation preview 📚: https://cpython-previews--106522.org.readthedocs.build/