Entering function def generates inexplicable syntax error
Bug #565466 reported by
Mitch Berkson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IPython |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
Interactively entering the following function definition causes a syntax error on line 5:
def g(b):
if b:
x = b + 10
return x
else:
return b
Error:
File "<ipython console>", line 5
lse:
^
SyntaxError: invalid syntax
Python 2.5
IPython 0.10
Ubuntu Hardy
Changed in ipython: | |
status: | New → Confirmed |
status: | Confirmed → Incomplete |
To post a comment you must log in.
That's very odd. Unfortunately I can't reproduce it here. I don't have a Hardy box, but on a Karmic one with 0.10 and python 2.5 (2.5.4 to be exact), everything works as expected:
Python 2.5.4 (r254:67916, Jan 20 2010, 21:44:03)
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: def g(b):
...: if b:
...: x = b + 10
...: return x
...: else:
...: return b
...:
...:
I haven't the foggiest idea what could be causing this, and without a way to even reproduce it (I've never seen something like it before either), I'm not sure I can work on fixing it.
Is this on a stock Hardy install with the system python and ipython, or is it using a custom install?