Message114950
There is no way to decide if a string literal should be non-unicode when the default has been set to unicode_literals. Please see:
>>> import ast
>>> ast.dump( ast.parse( """c = "d" """ ) )
"Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s='d'))])"
>>> from __future__ import unicode_literals
>>> ast.dump( ast.parse( """c = "d" """ ) )
"Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s='d'))])"
>>> ast.dump( ast.parse( """c = b"d" """ ) )
"Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s='d'))])"
>>> ast.dump( ast.parse( """c = u"d" """ ) )
"Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s=u'd'))])"
I have checked fields, but didn't find anything either. Without an indication of the Str literal type, its type cannot be detected. In either case it is "str" and may or not have to be converted to a unicode value. |
|
Date |
User |
Action |
Args |
2010-08-26 00:47:54 | kayhayen | set | recipients:
+ kayhayen |
2010-08-26 00:47:54 | kayhayen | set | messageid: <1282783674.62.0.292331118053.issue9690@psf.upfronthosting.co.za> |
2010-08-26 00:47:52 | kayhayen | link | issue9690 messages |
2010-08-26 00:47:51 | kayhayen | create | |
|