Message114019
| Author |
cben |
| Recipients |
cben |
| Date |
2010年08月15日.22:52:07 |
| SpamBayes Score |
5.7913643e-05 |
| Marked as misclassified |
No |
| Message-id |
<1281912730.25.0.579832640698.issue9618@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
[Spinoff of http://bugs.python.org/issue3559]
If you manage to type several simple statements into the prompt (by copy-pasting them, using Ctrl+J, or creative deletion), IDLE runs the first one and silently ignores the rest:
>>> x = 1
x = 2
>>> x
1
Moreover, it doesn't even parse the additional lines:
>>> x = 3
$@syntax error?!
>>> x
3
If the first statement is a compound statement, IDLE refuses with a SyntaxError at the begging of the second statement:
>>> def f():
return 42
f()
SyntaxError: invalid syntax
I believe in both cases the right least-surprise behavior is to run all statements.
If not, a clear error explaining that IDLE doesn't support multiple statements must be printed. But I can't see a reason to choose this over making it Just Work.
[Implementation: might or might not be related to http://bugs.python.org/issue7741] |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年08月15日 22:52:10 | cben | set | recipients:
+ cben |
| 2010年08月15日 22:52:10 | cben | set | messageid: <1281912730.25.0.579832640698.issue9618@psf.upfronthosting.co.za> |
| 2010年08月15日 22:52:07 | cben | link | issue9618 messages |
| 2010年08月15日 22:52:07 | cben | create |
|