[Python-Dev] The bytes type

Phillip J. Eby pje at telecommunity.com
Tue Jan 16 19:51:27 CET 2007


At 09:50 AM 1/16/2007 -0800, Guido van Rossum wrote:
>Actually it's very easy to write code using keys(), items() and
>values() that works as well in 2.2 as it works in 3.0: never use the
>iter* variants, and don't sweat the performance costs of creating a
>list so much. If you can't afford to create a list, iterate over the
>dict itself, which will give you the keys in both versions.

Actually, the main reason I use items() or keys() is because I want to 
mutate the dictionary, or because something else is going to mutate it 
while I'm looping over it.  But yeah, that discussion should be on Py3K.


>>Without having at least *some* 2.x version that can run 3.x code, I think
>>there is little chance of 3.0 becoming viable.  You've been comparing this
>>to Zope 2/Zope 3, but in that world there is something called "Five" that
>>lets you do Zope 3 things inside of Zope 2, so you have some chance of
>>porting your code in an incremental fashion, without having to leap
>>everything over in one go.
>
>I'm not aware of compromises to 3.0's architecture that were made in
>order to ease the transition though -- all of the burden was placed on
>Zope 2.x (though perhaps some optional compatibility packages were
>also added to Zope 3.0?).

Right, which is why I don't think we should worry about 2.5 as much as 2.6.


>>The analogy isn't perfect, because we are not so much trying to provide
>>backward compatibility in "Excel" as to add *forward* compatibility to
>>"123", but you get the idea.
>
>Such analogies are hard to get right; in this case he's talking about
>file interchange formats. Perhaps the closest analogy is pickling.

Actually, I meant the analogy for *code*.  If you can't write code that 
runs on some 2.x + 3.x combination, you have no way to cross the chasm.  If 
you're writing "spreadsheets for Excel" (code that runs on 3.x), you need 
to be able to "share them with 1-2-3 users" (run that code on 2.x).



More information about the Python-Dev mailing list