print statement does autocall inside interactive indented blocks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IPython |
New
|
Undecided
|
Unassigned | ||
ipython (Ubuntu) |
Triaged
|
High
|
Unassigned | ||
Lucid |
Triaged
|
High
|
Unassigned |
Bug Description
If I am in an interactive shell and do:
In [3]: class A(object):
...: def __init__(self):
...: print 'make'
...:
Everything operates correctly. However, If I then arrow up to change something in the class definition, say, for example, as below, I get this error:
In [18]: class A(object):
def __init__(self):
print 'not make'
-------> print('not make')
-------
IndentationError: expected an indented block (<ipython console>, line 3)
It's obvious what's happening - the autocall magic thinks print is a function rather than a statement. If I turn autocall off, all is happy... but can this be fixed so that it works as it should for just the case of a line that begins with "print"?
It's possible to work around this problem even if autocall is on, by putting brackets around the thing you are trying to print, which is usually acceptable.
It would be better if it were fixed.