Message174598
| 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) |
|