Message 234521 - Python tracker

Message234521

Author Joshua.Landau
Recipients Jeff.Kaufman, Joshua.Landau, NeilGirdhar, Rosuav, SpaghettiToastBook, andybuckley, belopolsky, berker.peksag, eric.araujo, eric.snow, ezio.melotti, georg.brandl, gvanrossum, ncoghlan, paul.moore, pconnell, r.david.murray, terry.reedy, twouters, zbysz
Date 2015-01-22.22:36:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421966162.65.0.666772183716.issue2292@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-01-22 22:36:02Joshua.Landausetrecipients: + Joshua.Landau, gvanrossum, twouters, georg.brandl, terry.reedy, paul.moore, ncoghlan, belopolsky, ezio.melotti, eric.araujo, andybuckley, r.david.murray, zbysz, eric.snow, Rosuav, berker.peksag, pconnell, NeilGirdhar, Jeff.Kaufman, SpaghettiToastBook
2015-01-22 22:36:02Joshua.Landausetmessageid: <1421966162.65.0.666772183716.issue2292@psf.upfronthosting.co.za>
2015-01-22 22:36:02Joshua.Landaulinkissue2292 messages
2015-01-22 22:36:02Joshua.Landaucreate