[Python-3000] u'text' as an alias for 'text'?
Walter Dörwald
walter at livinglogic.de
Thu Mar 20 23:20:20 CET 2008
Christian Heimes wrote:
> Barry Warsaw schrieb:
>> I proposed what I think is a better solution. Add
>>
>> from __future__ import unicode_strings
>>
>> to Py2.6. That would let you write Py3k compatible strings (and of
>> course byte literals) in 2.6. It would essential treat 'foo' as
>> u'foo' in the file with the future import.
>
> I proposed a similar solution an hour ago: from __future__ import
> py3k_literals
>
> It's in my answer to Lennarts' posting written at 21:15 local time.
Isn't the super secret -U option most of what we need?
./python.exe -U
Python 2.6a1+ (trunk:61276M, Mar 6 2008, 12:06:38)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> type('foo')
<type 'unicode'>
>>>
A future import would only affect one module though, -U is global.
Servus,
Walter
More information about the Python-3000
mailing list