eval()/exec() inconsistency

Ivan idivanov at hotmail.com
Thu Jul 19 04:30:45 EDT 2001


Hi,
haven't thoroughly read the 
Python langage specifications, but at first look 
this seem to be a good idea to correct this for
better consistency:

D:\>python
Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>>
>>> exec("");
>>>
>>> eval("");
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 0

    ^
SyntaxError: unexpected EOF while parsing
>>>
>>>


Empty string "" should be a valid code or invalid for evec(...) and
eval(...) ni the same way.

Regards,
Ivan



More information about the Python-list mailing list