[Python-Dev] [Python-3000] Warning for 2.6 and greater
Tim Delaney
tcdelaney at optusnet.com.au
Fri Jan 12 22:04:59 CET 2007
Georg Brandl wrote:
> Martin v. Löwis schrieb:
>>
>> What does that mean for the example James gave: if dict.items is
>> going to be an iterator in 3.0, what 2.x version can make it return
>> an iterator, when it currently returns a list?
>>
>> There simply can't be a 2.x version that *introduces* the new way,
>> as it is not merely a new API, but a changed API.
>
> Well, that is one of the cases in which that won't be possible ;)
Yes - but dict.items() *isn't* going to just return an iterator - it will
return a view. For most uses of dict.items(), this means there will not need
to be any code change.
I'm wondering if we might be going the wrong way about warning about
compatibility between 2.x and 3.x. Perhaps it might be better if the 3.0
alpha had a 2.x compatibility mode command-line flag, which is removed late
in the beta cycle.
Tim Delaney
More information about the Python-Dev
mailing list