[issue9307] Py_TPFLAGS_LONG_SUBCLASS is not documented
New submission from Alexander Belopolsky
Alexander Belopolsky
Antoine Pitrou
Alexander Belopolsky
.. These flags are primarily useful for C extension developers, there's little point checking them from Python code.
Of course there is: it helps debugging problems in types implemented
in C. For example, someone working on the numpy issue described in
msg110788, would probably appreciate having
inspect.TPFLAGS_INT_SUBCLASS and would probaly use it in his or hers
unit tests.
My point is: we have __flags__ attribute on type objects exposed in
python there should be a way to interpret what it means without
looking up object.h or C API documentation.
BTW, __flags__ itself could grow a docstring and deserves to be
mentioned in the docs. Note that copyreg.py uses it to determine
wither a class is dynamically allocated. Maybe this should also go
to inspect as inspect.isheaptype().
----------
_______________________________________
Python tracker
Changes by Terry J. Reedy
Yury V. Zaytsev added the comment:
Hi,
I agree with Alexander, I've been recently investigating a related problem and I found the lack of documentation on the subject quite frustrating; I therefore propose the attached patch to the docs.
Hope that helps,
--Yury.
----------
keywords: +patch
nosy: +zaytsev
Added file: http://bugs.python.org/file30952/tpflags-doc.patch
_______________________________________
Python tracker
Changes by STINNER Victor
Roundup Robot added the comment:
New changeset 37786ae8cc1c by Antoine Pitrou in branch '3.4':
Issue #9307: document the various Py_TPFLAGS_*_SUBCLASS flags. Patch by Yury V. Zaytsev.
http://hg.python.org/cpython/rev/37786ae8cc1c
New changeset d1a03834cec7 by Antoine Pitrou in branch 'default':
Issue #9307: document the various Py_TPFLAGS_*_SUBCLASS flags. Patch by Yury V. Zaytsev.
http://hg.python.org/cpython/rev/d1a03834cec7
----------
nosy: +python-dev
_______________________________________
Python tracker
Antoine Pitrou added the comment:
This is committed, thank you.
----------
resolution: -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2
_______________________________________
Python tracker
participants (6)
-
Alexander Belopolsky
-
Antoine Pitrou
-
Roundup Robot
-
STINNER Victor
-
Terry J. Reedy
-
Yury V. Zaytsev