mdipierro wrote this on Wed, Feb 04, 2009 at 08:01:35AM -0800.  My
reply is below.

> now consider this working code

> exec("""print 'abc\ncde'""")

I don't believe that works to begin with.  I assume you expect the
output to be:

>>> abc
>>> cde

... but what I get from python.2.4.4 is:

>>> Traceback (most recent call last):
>>>   File "./test.py", line 28, in ?
>>>     exec("""print 'abc\ncde'""")
>>>   File "<string>", line 1
>>>     print 'abc
>>>              ^
>>> SyntaxError: EOL while scanning single-quoted string

This is before tidying up.

Can you provide a different example?

*PythonTidy* tries to preserve literals from the original script.
However, it may resort to transliteration if more than one literal has
the same evaluation.  Perhaps you had a different literal in your code
before *PythonTidy* got ahold of it.

Also, running statements through *eval* can result in desirable
effects even though the arguments don't look like well-formed Python
code.  For example, you can do string substitution in the *eval*
statement.  *PythonTidy* doesn't see the arguments as code in their
own right, so it shouldn't interfere with them; nevertheless, IIRC,
use of *eval* is one of the perverse reasons that some Python
test-suite examples can't be tidied up.

-- 
.. Be Seeing You,
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather:  http://LacusVeris.com/WX
.. 5° — Wind NNW 12 mph


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to