On Apr 16, 2010, at 2:42 PM, Daniel Stutzbach wrote:
> 
> IIRC, there's a performance hack in dictobject.c that keeps track of whether 
> all of the keys are strings or not.  The hack is designed so that lookup 
> operations can call the string compare/hash functions directly if possible, 
> rather than going through the slower PyObject_ functions.
> 
> Consequently, validating **kwds should be cheap.
> 

Good thinking.

That would definitely be better than scanning the full dict on every call.


Raymond


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to