[issue26985] Information about CodeType in inspect documentation is outdated
New submission from Xiang Zhang: Information about CodeType in inspect documentation is outdated. It lacks attributes: co_kwonlyargcount, co_freevars, co_cellvars. And co_flags lacks many more options. These also apply to the comments of inspect.iscode source code. ---------- assignee: docs@python components: Documentation messages: 265197 nosy: docs@python, xiang.zhang priority: normal severity: normal status: open title: Information about CodeType in inspect documentation is outdated versions: Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Xiang Zhang added the comment: Attach patch. ---------- keywords: +patch Added file: http://bugs.python.org/file42793/inspect_doc.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Berker Peksag added the comment: I prefer to not duplicate the list in Lib/inspect.py. We did similar docstring cleanups in several modules (venv for example) recently. ---------- nosy: +berker.peksag stage: -> patch review type: -> behavior versions: +Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Xiang Zhang added the comment: So maybe remove the docstring entirely? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Berker Peksag added the comment: "Return true if the object is a code object." should stay. We can add a short sentence to refer people to the inspect documentation for the list of co_* attributes. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Xiang Zhang added the comment: Hmm, when I am going to delete the list in the docstring, I find other functions get lists too in inspect.py. So maybe we should open another issue to clean them after first merging this thread? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Changes by Xiang Zhang <angwerzx@126.com>: ---------- type: behavior -> versions: +Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Changes by Xiang Zhang <angwerzx@126.com>: ---------- pull_requests: +1233 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Xiang Zhang added the comment: New changeset a6902e662c18dc837d40664eaafe50a44aae6366 by Xiang Zhang in branch 'master': bpo-26985: Add missing info of code object in inspect documentation (GH-1090) https://github.com/python/cpython/commit/a6902e662c18dc837d40664eaafe50a44aa... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Changes by Xiang Zhang <angwerzx@126.com>: ---------- pull_requests: +1242 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Changes by Xiang Zhang <angwerzx@126.com>: ---------- pull_requests: +1243 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Xiang Zhang added the comment: New changeset 14944c62300f741488c2f28cb91ad1e3fef7343b by Xiang Zhang in branch '3.6': bpo-26985: Add missing info of code object in inspect documentation (GH-1090) (GH-1099) https://github.com/python/cpython/commit/14944c62300f741488c2f28cb91ad1e3fef... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Xiang Zhang added the comment: New changeset 72b1d419ac5f7cd9ef82ffd2ffe21aa9b34e21d2 by Xiang Zhang in branch '3.5': bpo-26985: Add missing info of code object in inspect documentation (GH-1090) (GH-1100) https://github.com/python/cpython/commit/72b1d419ac5f7cd9ef82ffd2ffe21aa9b34... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
Changes by Xiang Zhang <angwerzx@126.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26985> _______________________________________
participants (2)
-
Berker Peksag -
Xiang Zhang