[Python-Dev] [Python-3000] Warning for 2.6 and greater

"Martin v. Löwis" martin at v.loewis.de
Sat Jan 13 16:47:45 CET 2007


Anthony Baxter schrieb:
> There's a couple of ways I see it - we could add a "-3" command line 
> flag to enable 3.x compat, or maybe a from __future__ statement. 
> Although the latter would be a global thing, which is different to 
> how all existing from __future__s work, so probably not good.

Neither does really work: if some package is rewritten to expect
.items() to be an iterator, one would have to turn on that -3 option
if using that package. OTOH, some other package used at the same
time might expect just the opposite.

> I don't see a path forward that doesn't involve something painful, 
> so long as 3.0 is going to be the clean break.

There would be if there was some version which already had .items
as an iterator, but still supported .iteritems as well. Let's call
that version 2.99. It would be compatible with 2.6, but also with
3.0.

Regards,
Martin



More information about the Python-Dev mailing list