This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kayhayen
Recipients kayhayen
Date 2010-08-26.00:47:51
SpamBayes Score 6.668857e-07
Marked as misclassified No
Message-id <1282783674.62.0.292331118053.issue9690@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-08-26 00:47:54kayhayensetrecipients: + kayhayen
2010-08-26 00:47:54kayhayensetmessageid: <1282783674.62.0.292331118053.issue9690@psf.upfronthosting.co.za>
2010-08-26 00:47:52kayhayenlinkissue9690 messages
2010-08-26 00:47:51kayhayencreate