Py3.3 unicode literal and input()

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Jun 20 15:51:09 EDT 2012


On Wed, 20 Jun 2012 01:12:00 -0700, jmfauth wrote:

> Python 3.3.0a4 (v3.3.0a4:7c51388a3aa7+, May 31 2012, 20:15:21) [MSC v.
> 1600
> 32 bit (Intel)] on win32
>>>> ---
> running smidzero.py...
> ...smidzero has been executed

What is "smidzero.py", and what is it doing?

>>>> ---
> input(':')
> :éléphant
> 'éléphant'

Why are your input lines preceded by three dashes?



>>>> ---
> input(':')
> :u'éléphant'
> 'éléphant'
>>>> ---
> input(':')
> :u'\u00e9l\xe9phant'
> 'éléphant'

I cannot reproduce that behaviour. When I try it, I get the expected 
result:

>>> input(': ')
: u'\u00e9l\xe9phant'
"u'\\u00e9l\\xe9phant'"


I expect that the mysterious smidzero.py is monkey-patching the input 
builtin to do something silly. If that is the case, you are making a rod 
for your own back.


-- 
Steven



More information about the Python-list mailing list