Joshua Landau added the comment:

I imagine it like (in the map unpacking code)

    func_offset = (oparg >> 8) & 0xFF;
    num_maps = oparg & 0xFF;

    // later
    if (func_offset) {
        // do checks
        if (repeated_argument) {
            raise_error_from_function(PEEK(func_offset + num_maps));
        }
    }

This code should be relatively quick, in an already-slow opcode, and rather 
short.

If adding to CALL_FUNCTION_XXX, you would have to add an EXTENDED_ARG opcode 
(because CALL_FUNCTION_XXX already uses the bottom 16 bits), add checks for the 
top bits in the opcode, duplicate the (large) dictionary merging function. This 
doesn't seem like it saves much work.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2292>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to