[Python-Dev] Py3k bytes type in 2.x (Re: nonlocal keyword in 2.x?)

Lennart Regebro regebro at gmail.com
Thu Nov 5 21:36:09 CET 2009


2009/11/4 Nick Coghlan <ncoghlan at gmail.com>:
> In writing it up, it occurred to me that having that kind of thing in a
> "py3_compat" compatibility module (to be used as, e.g., "from py3_compat
> import str, bytes") would not only make it easier to use in multiple
> modules, but also easier for 2to3 to remove when forward porting.

Well, when using 2to3 it already handles that stuff. But a module like
that would be very handy if you want to support both 2.6 and 3.x
without 2to3. With such a module it would be quite simple.

In fact, I think the module should be called "timemachine". ;-)

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


More information about the Python-Dev mailing list