[Python-Dev] nonlocal keyword in 2.x?

Lennart Regebro regebro at gmail.com
Wed Nov 4 08:06:50 CET 2009


I should maybe point out that although I'm generally +1 on
backporting, I'm not specifically anything on backporting the nonlocal
keyword. There are probably things that would help more from a
compatibility standpoint than that.

For example, from __future__ import unicode_literals doesn't switch
the types. So this code will rais an assertion error in 2.6.

>>> from __future__ import unicode_literals
>>> assert isinstance("fghjkl", str)

While it of course will run fine in 3.0. Now this has a fairly trivial
workaround or two, but still.

I also would really like to see a real port of the bytes class to 2.6,
but I have a vague memory that there was some reason that wouldn't
work.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64


More information about the Python-Dev mailing list