Other than dict.items (and .keys and .values) returning a non-list,
are there any other cases where the Py3K idiom can't already be used
in (or at least backported to) Py 2.x?

Is there a chance that this special case could be handled by an import
hook in py 2.6?

For example 2.6 could have an additional LOAD_ATTR_PY3 opcode that
just handles the special cases before delegating to the normal
LOAD_ATTR.

It would be generated instead of LOAD_ATTR whenever

    >>> from __future__ import py3

was in effect.

Supporting 2.5 (and 2.2) would be a bit harder, but I think the new
exception syntax would already require a py3->py2 translator, and
these three names still seem like a fairly simple transform.  So long
as the "real" source is kept in py3 format, autogenerating python 2
code shouldn't be much worse than autogenerating pyc files.

-jJ
_______________________________________________
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

Reply via email to