[Python-3000] u'text' as an alias for 'text'?
Lennart Regebro
regebro at gmail.com
Thu Mar 20 21:22:40 CET 2008
On Thu, Mar 20, 2008 at 9:15 PM, Christian Heimes <lists at cheimes.de> wrote:
> How about "from __future__ import py3k_literals" for Python 2.6? The
> future statement turns several literals into Python 3.0 mode:
>
> * '' creates an unicode object instead of a str object
That would be fantastic indeed.
> * b'' creates a str object (aka bytes in Python 3.0)
It already does that, as b'' doesn't clash with any python 2 literal,
so that's already fixed.
> * 1 creates a long instead of an int
I haven't come up with any case where you need to know if it is a int
or a long, except if you are stripping out the L from a repr. So I
don't think it's necessary. But maybe it could be helpful?
> * 1L and u'' are invalid
That could be good, but deprecation warnings in -3 mode is enough, IMO.
--
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
More information about the Python-3000
mailing list