Author eli.bendersky
Recipients docs@python, eli.bendersky, ncoghlan
Date 2012-03-17.15:08:05
SpamBayes Score 6.26998e-05
Marked as misclassified No
Message-id <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za>
In-reply-to
Content
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);
[...]
History
Date User Action Args
2012-03-17 15:08:06eli.benderskysetrecipients: + eli.bendersky, ncoghlan, docs@python
2012-03-17 15:08:06eli.benderskysetmessageid: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za>
2012-03-17 15:08:05eli.benderskylinkissue14349 messages
2012-03-17 15:08:05eli.benderskycreate