This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pitrou Nosy List: docs@python, eli.bendersky, georg.brandl, ncoghlan, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-03-17 15:08 by eli.bendersky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue14349.1.patch eli.bendersky, 2012-03-23 12:14 review
Messages (4)
msg156161 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2012-03-17 15:08
The documentation of the MAKE_FUNCTION opcode in 'dis' says:

"Pushes a new function object on the stack. TOS is the code associated with the function. "

Which doesn't appear to be true. In Python/ceval.c:

[...]
        TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function)
        TARGET(MAKE_FUNCTION)
        _make_function:
        {
            int posdefaults = oparg & 0xff;
            int kwdefaults = (oparg>>8) & 0xff;
            int num_annotations = (oparg >> 16) & 0x7fff;

            w = POP(); /* qualname */
            v = POP(); /* code object */
            x = PyFunction_NewWithQualName(v, f->f_globals, w);
[...]
msg156649 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2012-03-23 12:14
Patch attached.
msg156692 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-03-24 12:18
Looks good to me.
msg156707 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-24 16:53
New changeset 242d3f8e8c50 by Eli Bendersky in branch 'default':
Issue #14349: Fix the doc of the MAKE_FUNCTION opcode in Doc/library/dis.rst to
http://hg.python.org/cpython/rev/242d3f8e8c50
History
Date User Action Args
2022-04-11 14:57:28adminsetgithub: 58557
2012-03-24 16:54:09eli.benderskysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2012-03-24 16:53:23python-devsetnosy: + python-dev
messages: + msg156707
2012-03-24 12:18:30georg.brandlsetnosy: + georg.brandl
messages: + msg156692
2012-03-23 12:14:50eli.benderskysetfiles: + issue14349.1.patch
keywords: + patch
messages: + msg156649

stage: needs patch -> patch review
2012-03-17 15:59:37georg.brandlsetassignee: docs@python -> pitrou

nosy: + pitrou
2012-03-17 15:08:05eli.benderskycreate