Simon Cross wrote:
It struct me as odd that this one case shows such a big difference while the others show less of one.
I believe the %-formatting code has some optimisations in place where it realises it can just increment the reference count of the passed in string and return that, rather than having to build a new string object.
As for why you didn't see any differences in a couple of your tests: the .format() call wasn't actually substituting anything.
Unfortunately, the reasons why .format() doesn't complain about extra arguments never made it into the PEP. They can be found here:
http://mail.python.org/pipermail/python-dev/2006-May/065062.html Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ 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