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.

Author ncoghlan
Recipients barry, brett.cannon, ezio.melotti, ncoghlan, pitrou, pjenvey, rhettinger, zzzeek
Date 2012-11-03.01:44:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351907073.28.0.854874275863.issue16389@psf.upfronthosting.co.za>
In-reply-to
Content
Did you try moving the existing single-argument fast path to before the main if statement in _make_key? That is:

    if not kwds and len(args) == 1:
         key = args[0]
         key_type = type(key)
         if key_type in fasttypes:
             if typed:
                 return key, key_type
             return key

Such a special case is already present, but it's *after* a lot of the other processing *and* it doesn't fire when typed==True.

So instead of the simple 2-tuple creation above, you instead do the relatively wasteful:

    args + tuple(type(v) for v in args)
History
Date User Action Args
2012-11-03 01:44:34ncoghlansetrecipients: + ncoghlan, barry, brett.cannon, rhettinger, pitrou, pjenvey, ezio.melotti, zzzeek
2012-11-03 01:44:33ncoghlansetmessageid: <1351907073.28.0.854874275863.issue16389@psf.upfronthosting.co.za>
2012-11-03 01:44:33ncoghlanlinkissue16389 messages
2012-11-03 01:44:30ncoghlancreate