Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly #58557

Closed
elibendersky mannequin opened this issue Mar 17, 2012 · 4 comments
Closed

The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly #58557

elibendersky mannequin opened this issue Mar 17, 2012 · 4 comments
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@elibendersky
Copy link
Mannequin

elibendersky mannequin commented Mar 17, 2012

BPO 14349
Nosy @birkenfeld, @ncoghlan, @pitrou
Files
  • issue14349.1.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/pitrou'
    closed_at = <Date 2012-03-24.16:54:09.259>
    created_at = <Date 2012-03-17.15:08:05.875>
    labels = ['type-bug', 'docs']
    title = "The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly"
    updated_at = <Date 2012-03-24.16:54:09.258>
    user = 'https://bugs.python.org/elibendersky'

    bugs.python.org fields:

    activity = <Date 2012-03-24.16:54:09.258>
    actor = 'eli.bendersky'
    assignee = 'pitrou'
    closed = True
    closed_date = <Date 2012-03-24.16:54:09.259>
    closer = 'eli.bendersky'
    components = ['Documentation']
    creation = <Date 2012-03-17.15:08:05.875>
    creator = 'eli.bendersky'
    dependencies = []
    files = ['25002']
    hgrepos = []
    issue_num = 14349
    keywords = ['patch']
    message_count = 4.0
    messages = ['156161', '156649', '156692', '156707']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'ncoghlan', 'pitrou', 'eli.bendersky', 'docs@python', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14349'
    versions = ['Python 3.3']

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Mar 17, 2012

    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);
    [...]

    @elibendersky elibendersky mannequin assigned docspython Mar 17, 2012
    @elibendersky elibendersky mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Mar 17, 2012
    @birkenfeld birkenfeld assigned pitrou and unassigned docspython Mar 17, 2012
    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Mar 23, 2012

    Patch attached.

    @birkenfeld
    Copy link
    Member

    Looks good to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 24, 2012

    New changeset 242d3f8e8c50 by Eli Bendersky in branch 'default':
    Issue bpo-14349: Fix the doc of the MAKE_FUNCTION opcode in Doc/library/dis.rst to
    http://hg.python.org/cpython/rev/242d3f8e8c50

    @elibendersky elibendersky mannequin closed this as completed Mar 24, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants