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

Thomas Wouters thomas at python.org
Mon Jan 15 14:10:15 CET 2007


On 1/13/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>
> glyph at divmod.com schrieb:
> >  It would certainly be possible to have:
> >
> >    from __future__ import items_is_iter
> >
> > be the same as:
> >
> >    __py3k_compat_items_is_iter__ = True
> >
> > and have the 2.x series' items() method check the globals() of the
> > calling scope to identify the return value of items() in that particular
> > context.
>
> Why do you think that this would be that certainly possible?
> I cannot imagine an efficient implementation.


Ah, but can you imagine an inefficient one? If so, we're no longer arguing
about whether it's possible, but whether we want to pay the price. Given
that the dict.keys/values/items change hasn't been written and only broadly
designed, it's hard to tell *right now* what we can do to ease the
transition. I do believe we should be prepared to as much as we can, in
Python 2.6 and 2.7, to ease it (and the other transitions.) That means the
2to3 tool and warnings in appropriate places, and anything else we can do.
Including, if necessary, optionally futzing with the returned type of
dict.keys/values/items in Python 2.6, in order to make it a list-like type
that whines when it is being operated on in ways the 3.0 type won't allow.

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20070115/6965a6e5/attachment.html 


More information about the Python-Dev mailing list