quit() doesn't work in terminal #1117

Closed
bfroehle opened this Issue Dec 7, 2011 · 6 comments

Projects

None yet

2 participants

@bfroehle
[bfroehle@highorder]$ ipython
Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
Type "copyright", "credits" or "license" for more information.

IPython 0.12.beta -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: quit()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/bfroehle/<ipython-input-1-369dbed58733> in <module>()
----> 1 quit(())

TypeError: __call__() takes exactly 1 argument (2 given)
@bfroehle

git bisect places the regression in commit 17afbbe.

@takluyver takluyver was assigned Dec 7, 2011
@takluyver
IPython member

This looks like an issue with how we handle doing autocalls. I'll look into it.

@bfroehle

Another oddity... why does /quit turn into quit(()) but /f only turns into f()?

In [1]: /quit
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/bfroehle/<ipython-input-1-369dbed58733> in <module>()
----> 1 quit(())

TypeError: __call__() takes exactly 1 argument (2 given)

@takluyver
IPython member

Again, I guess it's to do with the fact that quit is an IPyAutocall object, which forces it to become a function call separately from the normal autocall mechanisms.

@takluyver takluyver added a commit to takluyver/ipython that referenced this issue Dec 7, 2011
@takluyver takluyver Add test for gh-1117 c87e2e8
@takluyver
IPython member

See PR #1121.

@bfroehle bfroehle added a commit to bfroehle/ipython that referenced this issue Dec 7, 2011
@bfroehle bfroehle Do not add extra brackets for autocallable functions.
Closes gh-1117.
8303bd1
@takluyver
IPython member

Closed by PR #1121, merged with commit 7ea3e2f.

@takluyver takluyver closed this Dec 9, 2011
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@takluyver takluyver Add test for gh-1117 4bb047c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment