New Python 3.0 string formatting - really necessary?

Patrick Mullen saluk64007 at gmail.com
Sun Dec 21 03:57:46 EST 2008


On Sat, Dec 20, 2008 at 10:15 PM, r <rt8396 at gmail.com> wrote:
> On Dec 20, 11:11 pm, walterbyrd <walterb... at iname.com> wrote:
>> On Dec 20, 5:05 pm, Roy Smith <r... at panix.com>
>>
>> > He got really hung up on the % syntax.
>>
>> I guess it's good to know that there is, at least, one person in the
>> world doesn't like the % formatting. As least the move was not
>> entirely pointless.
>>
>> But, you must admit, of all the things people complain about with
>> Python, the % formatting is probably one of the least common
>> complaints. Complaints about Python's speed seem much more common.
>>
>> Yet, 3.0 makes the speed worse, and "fixes" a non-problem.

A few points:
1) The new formatting is NOT the reason for the speed slowdown.  So
this change at least was a no cost change.  No cost to interpreter
speed, and no cost as it doesn't replace the old sprintf style.  Of
all the things to complain about in python 3.0, the format method is
the silliest.
2) In my experience, major version changes tend to be slower than
before.  When a lot of things change, especially if very low-level
things change, as happened in python 3.0, the new code has not yet
went through many years of revision and optimization that the old code
has.  In my opinion, python 3 was rushed out the door a bit.  It could
have done with a few more months of optimization and polishing.
However, on the other hand, it is going to take so long for python
infrastructure to convert to python 3, that an earlier release makes
sense, even if it hasn't been excessively polished.  The biggest
reason for the speed change is the rewritten stdio and
unicode-everything.  Hopefully this stuff can be improved in future
updates.  I don't think anyone WANTS cpython to be slower.



More information about the Python-list mailing list