A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-May/035556.html below:

small details (Q); commit priv request

[Python-Dev] codeop: small details (Q); commit priv requestSamuele Pedroni pedronis@bluewin.ch
Mon, 12 May 2003 16:48:01 +0200
1)

Python 2.3b1 (#40, Apr 25 2003, 19:06:24) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import codeop
 >>> codeop.compile_command("",symbol="eval")
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "s:\transit\py23\lib\codeop.py", line 129, in compile_command
     return _maybe_compile(_compile, source, filename, symbol)
   File "s:\transit\py23\lib\codeop.py", line 106, in _maybe_compile
     raise SyntaxError, err1
   File "<input>", line 1
     pass
        ^
SyntaxError: invalid syntax


the error is basically an artifact of the logic that enforces:

compile_command("",symbol="single") === compile_command("pass",symbol="single")

(this makes typing enter immediately after the prompt at a simulated shell 
a nop as expected)

I would expect

compile_command("",symbol="eval")

to return None, i.e. to simply signal an incomplete expression (that is 
what would happen if the code for "eval" case would avoid the cited logic).

2) symbol = "exec" is silently accepted but the documentation intentionally 
only refers to "exec" and "single" as valid values for symbol. Maybe a 
ValueError should be raised.

Context: I was working on improving Jython codeop compatibility with 
CPython codeop.

Btw, as considered here by Guido 
http://sourceforge.net/tracker/index.php?func=detail&aid=645404&group_id=5470&atid=305470
I would ask to have commit privileges for CPython

regards






RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4