Hacker News Re-Imagined

IPython 8.0

  • 333 points
  • 4 days ago

  • @carreau
  • Created a post
  • • 123 comments

IPython 8.0


@ulnarkressty 4 days

Replying to @carreau 🎙

Jupyter notebooks are a favorite among our data scientists. However, we have gone back to plain python scripts for our bigger projects due to a simple reason - one must keep alive the notebook page while running lengthy experiments on a remote server. Due to some rogue windows updates we had a couple of destroyed experiments, which (as these things go), happened at a very inopportune moment.

OTOH for quick experiments notebooks are great, although I feel like the more modern the GUI the farther back we go in terms of experience. The latest updates to visual studio code's Jupyter extension for example have turned this into a thoroughly frustrating experience for the visually impaired - gray-on-gray-on-gray text and even more gray and transparent thin lines that are supposed to clearly mark where a cell ends and where the output begins. Unfortunately no amount of fiddling with the color scheme could fix these 'design' choices...

Reply


@nurettin 4 days

Replying to @carreau 🎙

I really enjoy bpython as my go-to python repl. Its django support and autocomplete is out of this world and the way it displays doc sections while using functions is really useful. Will take a look and compare ipython 8.0

Reply


@xtreak29 4 days

Replying to @carreau 🎙

Thanks for the release. I just upgraded and error messages are really nice. One bit I might be missing is that Python 3.10 added suggestions for AttributeError and NameError. It seems the suggestions are not stored in the exception object but calculated when Error is displayed. There is a note that that this won't work with IPython but it will be good to check if it's feasible.

https://bugs.python.org/issue38530 https://docs.python.org/3/whatsnew/3.10.html#attributeerrors

Reply


@gaff33 4 days

Replying to @carreau 🎙

I work with a bunch of 'data scientists' / 'strategists' and the like who love their notebooks but it's a pain to convert their code into an application!

In particular:

* Notebooks store code and data together, which is very messy if you want to look at [only] code history in git. * It's hard to turn a notebook into an assertive test. * Converting a notebook function into a python module basically involves cutting and pasting from the notebook into a .py file.

These must be common issues for anyone working in this area. Are there any guides on best practices for bridging from notebooks to applications?

Ideally I'd want to build a python application that's managed via git, but some modules / functions are lifted exactly from notebooks.

Reply


@kbd 4 days

Replying to @carreau 🎙

I’ve been using ptpython for a while because of its autocompletions. Really excited for that to come to ipython, but from a quick comparison ptpython’s still seems a bit better. You get automatic dropdowns where you have to hit tab in ipython (though it does seem faster than it used to be), and ptpython favors autocompleting arguments in the function signature.

IPython is more robust in various ways than ptpython so I’d prefer to switch back but maybe it still needs a bit of improvement. Open to suggestions if there is configuration I’m missing.

Seems like a great release though with tons of code cleanup.

Reply


@pattt 4 days

Replying to @carreau 🎙

Any recommended workflow of integrating IPython and vim in 2022 preferably being able to edit the notebooks, execute cells etc.? Currently this is one of the few reasons why I’m running a full-blown IDE with Jupyter integration. A mature plugin for integration having similar qualities to, say, Fugitive, would be vim users dream I suppose.

Reply


@carreau 4 days

Replying to @carreau 🎙

And I'm in the comments if you have any questions/feedback.

Reply


@jarpineh 4 days

Replying to @carreau 🎙

Yes. Good things here in the big list [1]. Fish style auto completion and traceback improvements are especially welcome. I find myself reaching for IPython more readily than browser Jupyter. REPL just feels better for control, though you can't beat browser for visuals.

In that vein I have probably somewhat obscure question, but since OP is here I thought I'd give it a shot. I'd like to use Unix shell in concert with IPython. I'd send data to IPython kernel from zsh terminal sessions and call functions get data back. This data I could then send to Visidata or browser for bespoke visualization. Or whatever else is available in the shell. I think Jupyter's messaging protocol kind of allows this, but I haven't managed to grasp the fine details enough to get anywhere. I can get to shell from IPython, but from the outside this REPL isn't accessible from the Unix "REPL".

[1] https://ipython.readthedocs.io/en/latest/whatsnew/version8.h...

Reply


@_coveredInBees 4 days

Replying to @carreau 🎙

Excited about this and have been a big fan of iPython since when I started coding in Python well over a decade ago. Might be a little while for switching to v8 due to the minimum 3.8+ version requirement for Python (which I totally understand from an ease of maintenance and forward looking mindset for the iPython projet). I use it all the time as my go-to REPL in Pycharm. Thanks to the team for all the work on it!

As an aside, I really wish the VSCode team did more to integrate iPython REPL more seamlessly into VSCode as that is one of the big blockers for me to using VSCode for anything Python related.

Reply


@onphonenow 4 days

Replying to @carreau 🎙

Black in there as a linter - I’ve had hood experiences with that

Reply


@Takizawamura 4 days

Replying to @carreau 🎙

"Tracebacks now highlight in which AST node the error occurs." Can you describe in simple terms how the AST works?

Reply


About Us

site design / logo © 2022 Box Piper