On 1/13/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com