News for hackers. Stuff that matters.
Re:Enable tab-completion in the interactive interpreter by d... by dmd on Sunday May 05, 2013 @10:15AM (#5658381)
This is great, but is there any reason whatsoever not to use ipython?
Re:Enable tab-completion in the interactive interpreter by d... by aaronharnly on Sunday May 05, 2013 @11:08AM (#5658514)
I use virtualenv for all projects, and frequently destroy and recreate virtualenvs. iPython takes a good while to install; doing it over and over again in fresh virtualenvs gets to be a chore, so I tend to do it only when I really need it.

I dunno, is there a better way, maybe installing iPython globally, but rewriting the shebang line to use /usr/bin/env python?

Re:Enable tab-completion in the interactive interpreter by d... by takluyver on Sunday May 05, 2013 @12:21PM (#5658822)
A global installation of IPython now recognises if you start it with a virtualenv active, and adds the virtualenv to sys.path so that you can import modules installed there.

It isn't limited to packages in the virtualenv - that is, it always behaves like you created the virtualenv with system-site-packages enabled, because it is importing its own modules from there. But for most interactive use, that's not a problem.

Re:Enable tab-completion in the interactive interpreter by d... by e12e on Sunday May 05, 2013 @11:54AM (#5658692)
AFAIK if you're using virtualenvs, you'd best bet would be various approaches to caching/proxying pypi. Won't help if the actual install (compile) times of ipython is a problem though.
Re:Enable tab-completion in the interactive interpreter by d... by tshepang on Sunday May 05, 2013 @11:30AM (#5658596)
You can always install it directly, and not in a virtualenv. Am I missing something?
Re:Enable tab-completion in the interactive interpreter by d... by Buttons840 on Sunday May 05, 2013 @11:42AM (#5658641)
If it's installed globally then it wont have access to the libraries installed only in the virtualenv. I think there's a way to work around this, but I haven't taken the time to look into it.
Re:Enable tab-completion in the interactive interpreter by d... by eclipticplane on Sunday May 05, 2013 @12:45PM (#5658918)
This should be fixed in the latest iPython versions. iPython is now virtualenv-aware -- it'll add your venv path at startup even if iPython is installed in global site-packages.
Re:Enable tab-completion in the interactive interpreter by d... by tshepang on Sunday May 05, 2013 @12:31PM (#5658857)
Now I know what I missed.
Re:Enable tab-completion in the interactive interpreter by d... by xnxn on Sunday May 05, 2013 @11:40AM (#5658633)
That would require you to enable global site- packages for that virtualenv.
Re:Enable tab-completion in the interactive interpreter by d... by tshepang on Sunday May 05, 2013 @10:29AM (#5658417)
I can think of a few:

* awareness

* the official interpreter works quite well already

* yet-another-tool to learn

Re:Enable tab-completion in the interactive interpreter by d... by a3n on Sunday May 05, 2013 @11:01AM (#5658501)
* You're in an interview and they don't have it.
Re:Enable tab-completion in the interactive interpreter by d... by gjhiggins on Sunday May 05, 2013 @01:01PM (#5658993)
The ipython interaction trace seems to run counter to the grain of doctest/docstring. I frequently copy and paste standard interactive sessions into a file to act as docstring exemplars or immediate doctest content for cross-platform/cross-version compatibility checking. I couldn't see how to do that with published ipython session output. Is it just a matter of changing the ipython prompt or is it a more fundamental issue?
Re:Enable tab-completion in the interactive interpreter by d... by fperez_org on Monday May 06, 2013 @04:12PM (#5664476)
You can always use `%doctest_mode` to toggle back and forth between IPython-style prompts and `>>>` ones (along with changing exception mode to be more standard-looking).
Re:Enable tab-completion in the interactive interpreter by d... by tshepang on Sunday May 05, 2013 @07:20PM (#5660163)
It's also ugly when copy-pasted, which does not stop people exposing such ugliness on sites like Stack Overflow.
Re:Enable tab-completion in the interactive interpreter by d... by cpdean on Sunday May 05, 2013 @02:00PM (#5659148)
Yeah, iPython already has tab completion, and everyone is still free to use it. It has plenty of great additional features, too!

Everyone is talking about reasons why using iPython can be impractical, or cumbersome/not-possible to install, but the important thing is that the default experience should strive to be the best experience.

Python has a pretty good standard library, and a pretty good batteries-included toolset, but talk to anyone who's experienced in it and you'll hear about all the Best Tools you have to install in order to be up to par: pip, virtualenv, ipython, third-party libraries to supplement what you want to do (requests, *-parse...).

When the community agrees that there are certain extras that are all good to install, it shows that the features they offer should probably be provided by default. I like Python, and I want Python to provide the best experience by default.

Re:Enable tab-completion in the interactive interpreter by d... by tshepang on Sunday May 05, 2013 @07:16PM (#5660151)
People are working (or planning to work) on some of those:

* pip (sort of): http://www.python.org/dev/peps/pep-0439/

* virtualenv: already in Python 3.3

* requests: http://kushaldas.in/posts/notes-from-language-summit-at-pyco...

As for IPython, many would agree it's not suitable for inclusion, which is not necessarily a bad thing. That does not stop anyone from stealing some of its features for inclusion in the default interactive interpreter though.

Re:Enable tab-completion in the interactive interpreter by d... by sigzero on Sunday May 05, 2013 @10:25AM (#5658402)
Maybe in a restricted environment where you can't install it?
Re:Enable tab-completion in the interactive interpreter by d... by scott_karana on Monday May 06, 2013 @01:14PM (#5663439)
It's annoying to have to install Conda for a single program.
Re:Enable tab-completion in the interactive interpreter by d... by MostAwesomeDude on Sunday May 05, 2013 @11:14AM (#5658528)
There are two reasons that I can think of that I have experienced. First, IPython simply doesn't behave like standard Python; you can have very obscure corner-case bugs in otherwise-normal code because of its magic. Second, if you're using PyPy, you don't get to use IPython.

Edit: I meant that PyPy isn't compatible with most of the things people use IPython for, like Numpy and Scipy, not that IPython's shell doesn't work on PyPy. Sorry.

Re:Enable tab-completion in the interactive interpreter by d... by freyrs3 on Sunday May 05, 2013 @11:20AM (#5658556)
The command line IPython does work with the PyPy interpreter.