
Release of IPython 5.0 - trymas
http://blog.jupyter.org/2016/07/08/ipython-5-0-released/
======
quantumtremor
Glad to hear improvements to the shell ipython interface, especially up/down
arrows on pasted code.

The most interesting part of this for me is that IPython 6 will not support
Python 2.

>Projects such as Matplotlib and SymPy plan to drop support in the next few
years, while a few projects like Scikit-Bio are already ahead of us, and
should be Python 3 only soon.

This was also very surprising for the standard reasons, especially for a
library like matplotlib. Glad to find Python moving forward. But what will
companies stuck on Python2 do? Will libraries like numpy, matplotlib, and
scipy all maintain a Python2 LTS?

~~~
wodenokoto
Companies stuck on python 2, have known for several years that life-time
support was disappearing and will do 1 of 3 things:

1) Get caught by surprise because they aren't planning. 2) Plan and pay the
price of upgrading their legacy code. 3) Join an active developed (currently
hypothetical) fork of python 2

I think in 2020 we'll see all 3 routes done by several companies. Better get
the popcorn ready!

~~~
data_hope
[https://github.com/dropbox/pyston](https://github.com/dropbox/pyston) seems
to be option 3

~~~
sciurus
Or PyPy. It's development is still heavily focused on Python 2 because that's
where the corporate sponsorship is.

------
wodenokoto
> It is important to note that users will always be able to use a Python 2
> kernel with the Jupyter Notebook, even when all of our projects have
> transitioned to Python 3

The way I understand this is that you will need python 3 to open ipython 6,
but once running, you can interact with python2 and run and inspect python 2
code. I think that is fine. I can't imagine a modern scientific setup that
can't readily create python 2 and 3 virtual environments.

~~~
carreau
No, not really, When you start a notebook, you could have an IPython 6 -
Python 3 kernel, OR an IPython 5 - Python 2 kernel. But Notebook & Jupyter !=
IPython

~~~
wodenokoto
I thought that just like the notebook, IPython was a "view" into a python
kernel. Is that wrongly understood?

~~~
takluyver
It's a bit confusing because parts of IPython became Jupyter. But since they
split, IPython is two things: the Python kernel for Jupyter, and a terminal
interface that uses the same core execution machinery within the process.

So it will only be possible to run Python 3 code in IPython 6, but it will
still be possible to use IPython 5 as a kernel for future versions of Jupyter.

------
brbsix
This is going to take some getting used-to. The visuals (specifically the
syntax highlighting and code completion) are very reminiscent of bpython.

On the other hand, I'm really happy to say farewell to readline. I've been
stuck with readline v6.2.4.1 for ages just so I can have proper linewrap [0].
Of course this breaks virtualenv creation so you end up having to override the
system readline [1]. Needless to say, this is well overdue.

[0]:
[https://github.com/ipython/ipython/issues/3329/](https://github.com/ipython/ipython/issues/3329/)

[1]:
[https://github.com/pypa/virtualenv/issues/4#issuecomment-966...](https://github.com/pypa/virtualenv/issues/4#issuecomment-966276)

------
thomasahle
As someone who's never used ipython before, but used the standard python
interactive terminal a lot, I'm very impressed!

The best feature I've discovered so far, is that when I want to change a
function, I can simply 'up arrow', and I get the whole thing! Not a single
line of the function, as in the normal python terminal. And if I write a
syntax error while typing the function, it tells me immediately!

Does anybody have other examples of great features in ipython over the
standard python terminal?

~~~
brbsix
For one, you can just paste in a bunch of code. Try doing that in the standard
terminal!

Another feature I end up using constantly is the documentation support. Say
you want to read the docstring for an object, just prefix or append a '?' to
the object, e.g. 'subprocess?'.

If you want to examine the source code for the object, just prefix or append
'??', e.g. 'subprocess.call??'.

~~~
thomasahle
> For one, you can just paste in a bunch of code. Try doing that in the
> standard terminal!

Usually I can paste code just fine, I think? As long as the indentation is
correct and I have double blank lines between functions, etc.

> Say you want to read the docstring for an object, just prefix or append a
> '?' to the object, e.g. 'subprocess?'

Isn't that the same as typing `help(subprocess)` in the standard terminal?

> If you want to examine the source code for the object, just prefix or append
> '??', e.g. 'subprocess.call??'.

That's pretty cool :-)

~~~
brbsix
Just try pasting the following into the default interpreter, exactly as-is:

    
    
        class Sample:
    
            def __init__(self):
                print('hehe')
    
        s = Sample()
    

IPython wouldn't flinch.

~~~
gknoy
Note that if you're doing this in a terminal, you MIGHT need to first do
`%cpaste`:

[https://gist.github.com/gknoy/97de793db43ff7ea4d4bfd1bab96b4...](https://gist.github.com/gknoy/97de793db43ff7ea4d4bfd1bab96b408)

It seemed to work fine when I didn't use `%cpaste`, though, so that might be a
vestigial thing? (I remember having to do it on my linux workstation, so maybe
it's just my mac terminal behaving differently.)

The cool thing about directly pasting is, if you fumble the indentation like I
did when I initially pasted, it auto-indents for you. ;)

~~~
takluyver
In previous releases, you had to use %cpaste. With IPython 5, so long as your
terminal supports 'bracketed paste', it should just work. We'll probably
deprecate %cpaste eventually.

We got this feature with no effort on our part - it's built into
prompt_toolkit.

------
ppod
There is a particular behaviour in RStudio that I would really love to be able
to do in python, but haven't found the combination of IDE/or notebook that
will do it yet:

I want to execute through lines with cmd-return, or by highlighting and
pressing cmd-return, and then see the change in the variables in a separate
pane, like RStudio's environment pane. Bonus points if I can click on table
variables in the environment pane and examine them in a separate tab with
sorting and searching. Spyder comes closest but the execution part doesn't
work as fluidly.

~~~
aeroevan
Sounds like you're looking for something like:
[https://github.com/yhat/rodeo](https://github.com/yhat/rodeo)

~~~
denfromufa
Also spyder: [https://github.com/spyder-ide/spyder](https://github.com/spyder-
ide/spyder)

------
xvilka
Thanks to ipython, radare2 (reverse engineering framework) now has a very
useful python shell with autocompletion:
[https://asciinema.org/a/16ko4jd1e6kdrqkqjxeu248hm](https://asciinema.org/a/16ko4jd1e6kdrqkqjxeu248hm)

~~~
mkesper
Thanks to prompt_toolkit, IPython now supports:

    
    
        Syntax highlighting as you type
        Real multi-line editing (up and down arrow keys move between lines)
        Multi-line paste without breaking indentation or immediately executing code
        Better code completion interface (we plan to improve that more)
        Optional mouse support

------
tbarbugli
"The awkward dependencies on pyreadline for Windows and gnureadline for Mac
prompted Thomas Kluyver to replace the old machinery with a brand new pure-
python readline replacement: prompt_toolkit."

I was waiting for something like this for years!

------
ferdinandvwyk
Multiline support - my prayers have been answered! Copying/pasting code and
modifying multiline commands from your history was easily the most annoying
thing about ipython.

~~~
tbarbugli
Agreed, though %edit is still a better (and already existing) way to deal with
multi line in my opinion ;)

~~~
phreeza
For me it would be, if only the result of %edit would make it into the
history...

------
bobwaycott
Syntax highlighting and line navigation look awesome. The big news is this is
the last release to support Python 2.x. Oh, and no more readline. Thank the
gods.

------
ericjang
Kudos to the iPython / Jupyter team for spearheading such an important dev-
productivity tool. I use your software all the time. I also appreciate the
effort to migrate everybody to Python3.

------
aliencat
Is there a way to enable vi mode in iPython 5? Since it no longer depends on
readline library, putting `set editing-mode vi` in ~/.inputrc file no longer
seems to work.

~~~
carreau
Yes, please read the release notes.

~~~
aliencat
for reference:
[http://ipython.readthedocs.io/en/stable/whatsnew/version5.ht...](http://ipython.readthedocs.io/en/stable/whatsnew/version5.html)

tldr; add `c.TerminalInteractiveShell.editing_mode = 'vi'` to
ipython_config.py

------
farmerj
Twitching on the floor... blinky blinky cursor, is there no way to make it go
away..? looks in the feature list. Went back to 4. _

~~~
carreau
That's a terminal preference. E.G: iterm> Preference > Text > Blink Cursor ->
uncheck it. Tada !

------
thuruv
Damn, the storm already hit python 2.x. Have to move on.

