##// END OF EJS Templates
update changes in API
Matthias Bussonnier -
Show More
@@ -1,765 +1,771 b''
1 1 ============
2 2 7.x Series
3 3 ============
4 4
5 5 IPython 7.10.0
6 6 ==============
7 7
8 8 IPython 7.10 is the first double digit minor release in the last decade, and
9 9 first since the release of IPython 1.0, previous double digit minor release was
10 10 in August 2009.
11 11
12 12 We've been trying to give you regular release on the last Friday of every month
13 13 for a guaranty of rapid access to bug fixes and new features.
14 14
15 15 Unlike the previous first few releases that have seen only a couple of code
16 16 changes, 7.10 bring a number of changes, new features and bugfixes.
17 17
18 18 Stop Support for Python 3.5 – Adopt NEP 29
19 19 ------------------------------------------
20 20
21 21 IPython has decided to follow the informational `NEP 29
22 22 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_ which layout a clear
23 23 policy as to which version of (C)Python and NumPy are supported.
24 24
25 25 We thus dropped support for Python 3.5, and cleaned up a number of code path
26 26 that were Python-version dependant. If you are on 3.5 or earlier pip should
27 27 automatically give you the latest compatible version of IPython so you do not
28 28 need to pin to a given version.
29 29
30 30 Support for Prompt Toolkit 3.0
31 31 ------------------------------
32 32
33 33 Prompt Toolkit 3.0 was release a week before IPython 7.10 and introduces a few
34 34 breaking changes. We believe IPython 7.10 should be compatible with both Prompt
35 35 Toolkit 2.x and 3.x, though it has not been extensively tested with 3.x so
36 36 please report any issues.
37 37
38 38
39 39 Prompt Rendering Performance improvements
40 40 -----------------------------------------
41 41
42 42 Pull Request :ghpull:`11933` introduced an optimisation in the prompt rendering
43 43 logic that should decrease the resource usage of IPython when using the
44 44 _default_ configuration but could potentially introduce a regression of
45 45 functionalities if you are using a custom prompt.
46 46
47 47 We know assume if you haven't changed the default keybindings that the prompt
48 48 **will not change** during the duration of your input – which is for example
49 49 not true when using vi insert mode that switches between `[ins]` and `[nor]`
50 50 for the current mode.
51 51
52 52 If you are experiencing any issue let us know.
53 53
54 54 Code autoformatting
55 55 -------------------
56 56
57 57 The IPython terminal can now auto format your code just before entering a new
58 58 line or executing a command. To do so use the
59 59 ``--TerminalInteractiveShell.autoformatter`` option and set it to ``'black'``;
60 60 if black is installed IPython will use black to format your code when possible.
61 61
62 62 IPython cannot always properly format your code; in particular it will
63 63 auto formatting with *black* will only work if:
64 64
65 65 - Your code does not contains magics or special python syntax.
66 66
67 67 - There is no code after your cursor.
68 68
69 69 The Black API is also still in motion; so this may not work with all versions of
70 70 black.
71 71
72 72 It should be possible to register custom formatter, though the API is till in
73 73 flux.
74 74
75 75 Arbitrary Mimetypes Handing in Terminal (Aka inline images in terminal)
76 76 -----------------------------------------------------------------------
77 77
78 78 When using IPython terminal it is now possible to register function to handle
79 79 arbitrary mimetypes. While rendering non-text based representation was possible in
80 80 many jupyter frontend; it was not possible in terminal IPython, as usually
81 81 terminal are limited to displaying text. As many terminal these days provide
82 82 escape sequences to display non-text; bringing this loved feature to IPython CLI
83 83 made a lot of sens. This functionality will not only allow inline images; but
84 84 allow opening of external program; for example ``mplayer`` to "display" sound
85 85 files.
86 86
87 87 So far only the hooks necessary for this are in place, but no default mime
88 88 renderers added; so inline images will only be available via extensions. We will
89 89 progressively enable these features by default in the next few releases, and
90 90 contribution is welcomed.
91 91
92 92 We welcome any feedback on the API. See :ref:`shell_mimerenderer` for more
93 93 informations.
94 94
95 95 This is originally based on work form in :ghpull:`10610` from @stephanh42
96 96 started over two years ago, and still a lot need to be done.
97 97
98 98 MISC
99 99 ----
100 100
101 101 - Completions can define their own ordering :ghpull:`11855`
102 102 - Enable Plotting in the same cell than the one that import matplotlib
103 103 :ghpull:`11916`
104 104 - Allow to store and restore multiple variables at once :ghpull:`11930`
105 105
106 106 You can see `all pull-requests <https://github.com/ipython/ipython/pulls?q=is%3Apr+milestone%3A7.10+is%3Aclosed>`_ for this release.
107 107
108 108 API Changes
109 109 -----------
110 110
111 Change of API and exposed objects automatically detected using `frappuccino <https://pypi.org/project/frappuccino/>`_ :
111 Change of API and exposed objects automatically detected using `frappuccino <https://pypi.org/project/frappuccino/>`_ (still in beta):
112 112
113 The following items are new in IPython 7.10:
114 + IPython.terminal.shortcuts.reformat_text_before_cursor
115 + IPython.terminal.prompts.RichPromptDisplayHook.write_format_data
116 + IPython.terminal.interactiveshell.black_reformat_handler
113 The following items are new in IPython 7.10::
117 114
118 The following signatures differ between 7.9 and 7.10:
115 + IPython.terminal.shortcuts.reformat_text_before_cursor(buffer, document, shell)
116 + IPython.terminal.interactiveshell.PTK3
117 + IPython.terminal.interactiveshell.black_reformat_handler(text_before_cursor)
118 + IPython.terminal.prompts.RichPromptDisplayHook.write_format_data(self, format_dict, md_dict='None')
119
120 The following items have been removed in 7.10::
121
122 - IPython.lib.pretty.DICT_IS_ORDERED
123
124 The following signatures differ between versions::
119 125
120 126 - IPython.extensions.storemagic.restore_aliases(ip)
121 127 + IPython.extensions.storemagic.restore_aliases(ip, alias='None')
122 128
123 129 Special Thanks
124 130 --------------
125 131
126 132 - @stephanh42 who started the work on inline images in terminal 2 years ago
127 133 - @augustogoulart who spent a lot of time triaging issues and responding to
128 134 users.
129 135 - @con-f-use who is my (@Carreau) first sponsor on GitHub, as a reminder if you
130 136 like IPython, Jupyter and many other library of the SciPy stack you can
131 137 donate to numfocus.org non profit
132 138
133 139 .. _version 790:
134 140
135 141 IPython 7.9.0
136 142 =============
137 143
138 144 IPython 7.9 is a small release with a couple of improvement and bug fixes.
139 145
140 146 - Xterm terminal title should be restored on exit :ghpull:`11910`
141 147 - special variables ``_``,``__``, ``___`` are not set anymore when cache size
142 148 is 0 or less. :ghpull:`11877`
143 149 - Autoreload should have regained some speed by using a new heuristic logic to
144 150 find all objects needing reload. This should avoid large objects traversal
145 151 like pandas dataframes. :ghpull:`11876`
146 152 - Get ready for Python 4. :ghpull:`11874`
147 153 - `%env` Magic now has heuristic to hide potentially sensitive values :ghpull:`11896`
148 154
149 155 This is a small release despite a number of Pull Request Pending that need to
150 156 be reviewed/worked on. Many of the core developers have been busy outside of
151 157 IPython/Jupyter and we thanks all contributor for their patience; we'll work on
152 158 these as soon as we have time.
153 159
154 160
155 161 .. _version780:
156 162
157 163 IPython 7.8.0
158 164 =============
159 165
160 166 IPython 7.8.0 contain a few bugfix and 2 new APIs:
161 167
162 168 - Enable changing the font color for LaTeX rendering :ghpull:`11840`
163 169 - and Re-Expose some PDB API (see below)
164 170
165 171 Expose Pdb API
166 172 --------------
167 173
168 174 Expose the built-in ``pdb.Pdb`` API. ``Pdb`` constructor arguments are generically
169 175 exposed, regardless of python version.
170 176 Newly exposed arguments:
171 177
172 178 - ``skip`` - Python 3.1+
173 179 - ``nosiginnt`` - Python 3.2+
174 180 - ``readrc`` - Python 3.6+
175 181
176 182 Try it out::
177 183
178 184 from IPython.terminal.debugger import TerminalPdb
179 185 pdb = TerminalPdb(skip=["skipthismodule"])
180 186
181 187
182 188 See :ghpull:`11840`
183 189
184 190 .. _version770:
185 191
186 192 IPython 7.7.0
187 193 =============
188 194
189 195 IPython 7.7.0 contain multiple bug fixes and documentation updates; Here are a
190 196 few of the outstanding issue fixed:
191 197
192 198 - Fix a bug introduced in 7.6 where the ``%matplotlib`` magic would fail on
193 199 previously acceptable arguments :ghpull:`11814`.
194 200 - Fix the manage location on freebsd :ghpull:`11808`.
195 201 - Fix error message about aliases after ``%reset`` call in ipykernel
196 202 :ghpull:`11806`
197 203 - Fix Duplication completions in emacs :ghpull:`11803`
198 204
199 205 We are planning to adopt `NEP29 <https://github.com/numpy/numpy/pull/14086>`_
200 206 (still currently in draft) which may make this minor version of IPython the
201 207 last one to support Python 3.5 and will make the code base more aggressive
202 208 toward removing compatibility with older versions of Python.
203 209
204 210 GitHub now support to give only "Triage" permissions to users; if you'd like to
205 211 help close stale issues and labels issues please reach to us with your GitHub
206 212 Username and we'll add you to the triage team. It is a great way to start
207 213 contributing and a path toward getting commit rights.
208 214
209 215 .. _version761:
210 216
211 217 IPython 7.6.1
212 218 =============
213 219
214 220 IPython 7.6.1 contain a critical bugfix in the ``%timeit`` magic, which would
215 221 crash on some inputs as a side effect of :ghpull:`11716`. See :ghpull:`11812`
216 222
217 223
218 224 .. _whatsnew760:
219 225
220 226 IPython 7.6.0
221 227 =============
222 228
223 229 IPython 7.6.0 contains a couple of bug fixes and number of small features
224 230 additions as well as some compatibility with the current development version of
225 231 Python 3.8.
226 232
227 233 - Add a ``-l`` option to :magic:`psearch` to list the available search
228 234 types. :ghpull:`11672`
229 235 - Support ``PathLike`` for ``DisplayObject`` and ``Image``. :ghpull:`11764`
230 236 - Configurability of timeout in the test suite for slow platforms.
231 237 :ghpull:`11756`
232 238 - Accept any casing for matplotlib backend. :ghpull:`121748`
233 239 - Properly skip test that requires numpy to be installed :ghpull:`11723`
234 240 - More support for Python 3.8 and positional only arguments (pep570)
235 241 :ghpull:`11720`
236 242 - Unicode names for the completion are loaded lazily on first use which
237 243 should decrease startup time. :ghpull:`11693`
238 244 - Autoreload now update the types of reloaded objects; this for example allow
239 245 pickling of reloaded objects. :ghpull:`11644`
240 246 - Fix a bug where ``%%time`` magic would suppress cell output. :ghpull:`11716`
241 247
242 248
243 249 Prepare migration to pytest (instead of nose) for testing
244 250 ---------------------------------------------------------
245 251
246 252 Most of the work between 7.5 and 7.6 was to prepare the migration from our
247 253 testing framework to pytest. Most of the test suite should now work by simply
248 254 issuing ``pytest`` from the root of the repository.
249 255
250 256 The migration to pytest is just at its beginning. Many of our test still rely
251 257 on IPython-specific plugins for nose using pytest (doctest using IPython syntax
252 258 is one example of this where test appear as "passing", while no code has been
253 259 ran). Many test also need to be updated like ``yield-test`` to be properly
254 260 parametrized tests.
255 261
256 262 Migration to pytest allowed me to discover a number of issues in our test
257 263 suite; which was hiding a number of subtle issues – or not actually running
258 264 some of the tests in our test suite – I have thus corrected many of those; like
259 265 improperly closed resources; or used of deprecated features. I also made use of
260 266 the ``pytest --durations=...`` to find some of our slowest test and speed them
261 267 up (our test suite can now be up to 10% faster). Pytest as also a variety of
262 268 plugins and flags which will make the code quality of IPython and the testing
263 269 experience better.
264 270
265 271 Misc
266 272 ----
267 273
268 274 We skipped the release of 7.6 at the end of May, but will attempt to get back
269 275 on schedule. We are starting to think about making introducing backward
270 276 incompatible change and start the 8.0 series.
271 277
272 278 Special Thanks to Gabriel (@gpotter2 on GitHub), who among other took care many
273 279 of the remaining task for 7.4 and 7.5, like updating the website.
274 280
275 281 .. _whatsnew750:
276 282
277 283 IPython 7.5.0
278 284 =============
279 285
280 286 IPython 7.5.0 consist mostly of bug-fixes, and documentation updates, with one
281 287 minor new feature. The `Audio` display element can now be assigned an element
282 288 id when displayed in browser. See :ghpull:`11670`
283 289
284 290 The major outstanding bug fix correct a change of behavior that was introduce
285 291 in 7.4.0 where some cell magics would not be able to access or modify global
286 292 scope when using the ``@needs_local_scope`` decorator. This was typically
287 293 encountered with the ``%%time`` and ``%%timeit`` magics. See :ghissue:`11659`
288 294 and :ghpull:`11698`.
289 295
290 296 .. _whatsnew740:
291 297
292 298 IPython 7.4.0
293 299 =============
294 300
295 301 Unicode name completions
296 302 ------------------------
297 303
298 304 Previously, we provided completion for a unicode name with its relative symbol.
299 305 With this, now IPython provides complete suggestions to unicode name symbols.
300 306
301 307 As on the PR, if user types ``\LAT<tab>``, IPython provides a list of
302 308 possible completions. In this case, it would be something like::
303 309
304 310 'LATIN CAPITAL LETTER A',
305 311 'LATIN CAPITAL LETTER B',
306 312 'LATIN CAPITAL LETTER C',
307 313 'LATIN CAPITAL LETTER D',
308 314 ....
309 315
310 316 This help to type unicode character that do not have short latex aliases, and
311 317 have long unicode names. for example ``Ν°``, ``\GREEK CAPITAL LETTER HETA``.
312 318
313 319 This feature was contributed by Luciana Marques :ghpull:`11583`.
314 320
315 321 Make audio normalization optional
316 322 ---------------------------------
317 323
318 324 Added 'normalize' argument to `IPython.display.Audio`. This argument applies
319 325 when audio data is given as an array of samples. The default of `normalize=True`
320 326 preserves prior behavior of normalizing the audio to the maximum possible range.
321 327 Setting to `False` disables normalization.
322 328
323 329
324 330 Miscellaneous
325 331 -------------
326 332
327 333 - Fix improper acceptation of ``return`` outside of functions. :ghpull:`11641`.
328 334 - Fixed PyQt 5.11 backwards incompatibility causing sip import failure.
329 335 :ghpull:`11613`.
330 336 - Fix Bug where ``type?`` would crash IPython. :ghpull:`1608`.
331 337 - Allow to apply ``@needs_local_scope`` to cell magics for convenience.
332 338 :ghpull:`11542`.
333 339
334 340 .. _whatsnew730:
335 341
336 342 IPython 7.3.0
337 343 =============
338 344
339 345 .. _whatsnew720:
340 346
341 347 IPython 7.3.0 bring several bug fixes and small improvements that you will
342 348 described bellow.
343 349
344 350 The biggest change to this release is the implementation of the ``%conda`` and
345 351 ``%pip`` magics, that will attempt to install packages in the **current
346 352 environment**. You may still need to restart your interpreter or kernel for the
347 353 change to be taken into account, but it should simplify installation of packages
348 354 into remote environment. Installing using pip/conda from the command line is
349 355 still the prefer method.
350 356
351 357 The ``%pip`` magic was already present, but was only printing a warning; now it
352 358 will actually forward commands to pip.
353 359
354 360 Misc bug fixes and improvements:
355 361
356 362 - Compatibility with Python 3.8.
357 363 - Do not expand shell variable in execution magics, and added the
358 364 ``no_var_expand`` decorator for magic requiring a similar functionality
359 365 :ghpull:`11516`
360 366 - Add ``%pip`` and ``%conda`` magic :ghpull:`11524`
361 367 - Re-initialize posix aliases after a ``%reset`` :ghpull:`11528`
362 368 - Allow the IPython command line to run ``*.ipynb`` files :ghpull:`11529`
363 369
364 370 IPython 7.2.0
365 371 =============
366 372
367 373 IPython 7.2.0 brings minor bugfixes, improvements, and new configuration options:
368 374
369 375 - Fix a bug preventing PySide2 GUI integration from working :ghpull:`11464`
370 376 - Run CI on Mac OS ! :ghpull:`11471`
371 377 - Fix IPython "Demo" mode. :ghpull:`11498`
372 378 - Fix ``%run`` magic with path in name :ghpull:`11499`
373 379 - Fix: add CWD to sys.path *after* stdlib :ghpull:`11502`
374 380 - Better rendering of signatures, especially long ones. :ghpull:`11505`
375 381 - Re-enable jedi by default if it's installed :ghpull:`11506`
376 382 - Add New ``minimal`` exception reporting mode (useful for educational purpose). See :ghpull:`11509`
377 383
378 384
379 385 Added ability to show subclasses when using pinfo and other utilities
380 386 ---------------------------------------------------------------------
381 387
382 388 When using ``?``/``??`` on a class, IPython will now list the first 10 subclasses.
383 389
384 390 Special Thanks to Chris Mentzel of the Moore Foundation for this feature. Chris
385 391 is one of the people who played a critical role in IPython/Jupyter getting
386 392 funding.
387 393
388 394 We are grateful for all the help Chris has given us over the years,
389 395 and we're now proud to have code contributed by Chris in IPython.
390 396
391 397 OSMagics.cd_force_quiet configuration option
392 398 --------------------------------------------
393 399
394 400 You can set this option to force the %cd magic to behave as if ``-q`` was passed:
395 401 ::
396 402
397 403 In [1]: cd /
398 404 /
399 405
400 406 In [2]: %config OSMagics.cd_force_quiet = True
401 407
402 408 In [3]: cd /tmp
403 409
404 410 In [4]:
405 411
406 412 See :ghpull:`11491`
407 413
408 414 In vi editing mode, whether the prompt includes the current vi mode can now be configured
409 415 -----------------------------------------------------------------------------------------
410 416
411 417 Set the ``TerminalInteractiveShell.prompt_includes_vi_mode`` to a boolean value
412 418 (default: True) to control this feature. See :ghpull:`11492`
413 419
414 420 .. _whatsnew710:
415 421
416 422 IPython 7.1.0
417 423 =============
418 424
419 425 IPython 7.1.0 is the first minor release after 7.0.0 and mostly brings fixes to
420 426 new features, internal refactoring, and fixes for regressions that happened during the 6.x->7.x
421 427 transition. It also brings **Compatibility with Python 3.7.1**, as we're
422 428 unwillingly relying on a bug in CPython.
423 429
424 430 New Core Dev:
425 431
426 432 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
427 433 work on prompt_toolkit, and we'd like to recognise his impact by giving him
428 434 commit rights. :ghissue:`11397`
429 435
430 436 Notable Changes
431 437
432 438 - Major update of "latex to unicode" tab completion map (see below)
433 439
434 440 Notable New Features:
435 441
436 442 - Restore functionality and documentation of the **sphinx directive**, which
437 443 is now stricter (fail on error by daefault), has new configuration options,
438 444 has a brand new documentation page :ref:`ipython_directive` (which needs
439 445 some cleanup). It is also now *tested* so we hope to have less regressions.
440 446 :ghpull:`11402`
441 447
442 448 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
443 449 allowing a custom width and height to be set instead of using the video's
444 450 width and height. :ghpull:`11353`
445 451
446 452 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
447 453
448 454 - Allow Dynamic switching of editing mode between vi/emacs and show
449 455 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
450 456 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
451 457 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically switch
452 458 between modes.
453 459
454 460
455 461 Notable Fixes:
456 462
457 463 - Fix entering of **multi-line blocks in terminal** IPython, and various
458 464 crashes in the new input transformation machinery :ghpull:`11354`,
459 465 :ghpull:`11356`, :ghpull:`11358`. These also fix a **Compatibility bug
460 466 with Python 3.7.1**.
461 467
462 468 - Fix moving through generator stack in ipdb :ghpull:`11266`
463 469
464 470 - %Magic command arguments now support quoting. :ghpull:`11330`
465 471
466 472 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
467 473
468 474 - Remove implicit dependency on ``ipython_genutils`` :ghpull:`11317`
469 475
470 476 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
471 477 mode. :ghpull:`11382`
472 478
473 479 - Fix mishandling of magics and ``= !`` assignment just after a dedent in
474 480 nested code blocks :ghpull:`11418`
475 481
476 482 - Fix instructions for custom shortcuts :ghpull:`11426`
477 483
478 484
479 485 Notable Internals improvements:
480 486
481 487 - Use of ``os.scandir`` (Python 3 only) to speed up some file system operations.
482 488 :ghpull:`11365`
483 489
484 490 - use ``perf_counter`` instead of ``clock`` for more precise
485 491 timing results with ``%time`` :ghpull:`11376`
486 492
487 493 Many thanks to all the contributors and in particular to ``bartskowron`` and
488 494 ``tonyfast`` who handled some pretty complicated bugs in the input machinery. We
489 495 had a number of first time contributors and maybe hacktoberfest participants that
490 496 made significant contributions and helped us free some time to focus on more
491 497 complicated bugs.
492 498
493 499 You
494 500 can see all the closed issues and Merged PR, new features and fixes `here
495 501 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
496 502
497 503 Unicode Completion update
498 504 -------------------------
499 505
500 506 In IPython 7.1 the Unicode completion map has been updated and synchronized with
501 507 the Julia language.
502 508
503 509 Added and removed character characters:
504 510
505 511 ``\jmath`` (``Θ·``), ``\\underleftrightarrow`` (U+034D, combining) have been
506 512 added, while ``\\textasciicaron`` have been removed
507 513
508 514 Some sequences have seen their prefix removed:
509 515
510 516 - 6 characters ``\text...<tab>`` should now be inputed with ``\...<tab>`` directly,
511 517 - 45 characters ``\Elz...<tab>`` should now be inputed with ``\...<tab>`` directly,
512 518 - 65 characters ``\B...<tab>`` should now be inputed with ``\...<tab>`` directly,
513 519 - 450 characters ``\m...<tab>`` should now be inputed with ``\...<tab>`` directly,
514 520
515 521 Some sequences have seen their prefix shortened:
516 522
517 523 - 5 characters ``\mitBbb...<tab>`` should now be inputed with ``\bbi...<tab>`` directly,
518 524 - 52 characters ``\mit...<tab>`` should now be inputed with ``\i...<tab>`` directly,
519 525 - 216 characters ``\mbfit...<tab>`` should now be inputed with ``\bi...<tab>`` directly,
520 526 - 222 characters ``\mbf...<tab>`` should now be inputed with ``\b...<tab>`` directly,
521 527
522 528 A couple of characters had their sequence simplified:
523 529
524 530 - ``Γ°``, type ``\dh<tab>``, instead of ``\eth<tab>``
525 531 - ``Δ§``, type ``\hbar<tab>``, instead of ``\Elzxh<tab>``
526 532 - ``ΙΈ``, type ``\ltphi<tab>``, instead of ``\textphi<tab>``
527 533 - ``Ο΄``, type ``\varTheta<tab>``, instead of ``\textTheta<tab>``
528 534 - ``ℇ``, type ``\eulermascheroni<tab>``, instead of ``\Eulerconst<tab>``
529 535 - ``β„Ž``, type ``\planck<tab>``, instead of ``\Planckconst<tab>``
530 536
531 537 - U+0336 (COMBINING LONG STROKE OVERLAY), type ``\strike<tab>``, instead of ``\Elzbar<tab>``.
532 538
533 539 A couple of sequences have been updated:
534 540
535 541 - ``\varepsilon`` now gives ``Ι›`` (GREEK SMALL LETTER EPSILON) instead of ``Ξ΅`` (GREEK LUNATE EPSILON SYMBOL),
536 542 - ``\underbar`` now gives U+0331 (COMBINING MACRON BELOW) instead of U+0332 (COMBINING LOW LINE).
537 543
538 544
539 545 .. _whatsnew700:
540 546
541 547 IPython 7.0.0
542 548 =============
543 549
544 550 Released Thursday September 27th, 2018
545 551
546 552 IPython 7 includes major feature improvements.
547 553 This is also the second major version of IPython to support only
548 554 Python 3 – starting at Python 3.4. Python 2 is still community-supported
549 555 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
550 556 is on Jan 1st 2020.
551 557
552 558 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
553 559 backported more than `70 Pull-Requests
554 560 <https://github.com/ipython/ipython/pulls?page=3&q=is%3Apr+sort%3Aupdated-desc+author%3Aapp%2Fmeeseeksdev++5.x&utf8=%E2%9C%93>`_, but there are still many PRs that required manual work. This is an area of the project where you can easily contribute by looking for `PRs that still need manual backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
555 561
556 562 The IPython 6.x branch will likely not see any further release unless critical
557 563 bugs are found.
558 564
559 565 Make sure you have pip > 9.0 before upgrading. You should be able to update by running:
560 566
561 567 .. code::
562 568
563 569 pip install ipython --upgrade
564 570
565 571 .. only:: ipydev
566 572
567 573 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
568 574 version, use pip ``--pre`` flag.
569 575
570 576 .. code::
571 577
572 578 pip install ipython --upgrade --pre
573 579
574 580
575 581 Or, if you have conda installed:
576 582
577 583 .. code::
578 584
579 585 conda install ipython
580 586
581 587
582 588
583 589 Prompt Toolkit 2.0
584 590 ------------------
585 591
586 592 IPython 7.0+ now uses ``prompt_toolkit 2.0``. If you still need to use an earlier
587 593 ``prompt_toolkit`` version, you may need to pin IPython to ``<7.0``.
588 594
589 595 Autowait: Asynchronous REPL
590 596 ---------------------------
591 597
592 598 Staring with IPython 7.0 on Python 3.6+, IPython can automatically ``await``
593 599 top level code. You should not need to access an event loop or runner
594 600 yourself. To learn more, read the :ref:`autoawait` section of our docs, see
595 601 :ghpull:`11265`, or try the following code::
596 602
597 603 Python 3.6.0
598 604 Type 'copyright', 'credits' or 'license' for more information
599 605 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
600 606
601 607 In [1]: import aiohttp
602 608 ...: result = aiohttp.get('https://api.github.com')
603 609
604 610 In [2]: response = await result
605 611 <pause for a few 100s ms>
606 612
607 613 In [3]: await response.json()
608 614 Out[3]:
609 615 {'authorizations_url': 'https://api.github.com/authorizations',
610 616 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
611 617 ...
612 618 }
613 619
614 620 .. note::
615 621
616 622 Async integration is experimental code, behavior may change or be removed
617 623 between Python and IPython versions without warnings.
618 624
619 625 Integration is by default with `asyncio`, but other libraries can be configured --
620 626 like ``curio`` or ``trio`` -- to improve concurrency in the REPL::
621 627
622 628 In [1]: %autoawait trio
623 629
624 630 In [2]: import trio
625 631
626 632 In [3]: async def child(i):
627 633 ...: print(" child %s goes to sleep"%i)
628 634 ...: await trio.sleep(2)
629 635 ...: print(" child %s wakes up"%i)
630 636
631 637 In [4]: print('parent start')
632 638 ...: async with trio.open_nursery() as n:
633 639 ...: for i in range(3):
634 640 ...: n.spawn(child, i)
635 641 ...: print('parent end')
636 642 parent start
637 643 child 2 goes to sleep
638 644 child 0 goes to sleep
639 645 child 1 goes to sleep
640 646 <about 2 seconds pause>
641 647 child 2 wakes up
642 648 child 1 wakes up
643 649 child 0 wakes up
644 650 parent end
645 651
646 652 See :ref:`autoawait` for more information.
647 653
648 654
649 655 Asynchronous code in a Notebook interface or any other frontend using the
650 656 Jupyter Protocol will require further updates to the IPykernel package.
651 657
652 658 Non-Asynchronous code
653 659 ~~~~~~~~~~~~~~~~~~~~~
654 660
655 661 As the internal API of IPython is now asynchronous, IPython needs to run under
656 662 an event loop. In order to allow many workflows, (like using the :magic:`%run`
657 663 magic, or copy-pasting code that explicitly starts/stop event loop), when
658 664 top-level code is detected as not being asynchronous, IPython code is advanced
659 665 via a pseudo-synchronous runner, and may not advance pending tasks.
660 666
661 667 Change to Nested Embed
662 668 ~~~~~~~~~~~~~~~~~~~~~~
663 669
664 670 The introduction of the ability to run async code had some effect on the
665 671 ``IPython.embed()`` API. By default, embed will not allow you to run asynchronous
666 672 code unless an event loop is specified.
667 673
668 674 Effects on Magics
669 675 ~~~~~~~~~~~~~~~~~
670 676
671 677 Some magics will not work with async until they're updated.
672 678 Contributions welcome.
673 679
674 680 Expected Future changes
675 681 ~~~~~~~~~~~~~~~~~~~~~~~
676 682
677 683 We expect more internal but public IPython functions to become ``async``, and
678 684 will likely end up having a persistent event loop while IPython is running.
679 685
680 686 Thanks
681 687 ~~~~~~
682 688
683 689 This release took more than a year in the making.
684 690 The code was rebased a number of
685 691 times; leading to commit authorship that may have been lost in the final
686 692 Pull-Request. Huge thanks to many people for contribution, discussion, code,
687 693 documentation, use-cases: dalejung, danielballan, ellisonbg, fperez, gnestor,
688 694 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
689 695
690 696
691 697 Autoreload Improvement
692 698 ----------------------
693 699
694 700 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
695 701 classes. Earlier, only methods existing as of the initial import were being
696 702 tracked and updated.
697 703
698 704 This new feature helps dual environment development - Jupyter+IDE - where the
699 705 code gradually moves from notebook cells to package files as it gets
700 706 structured.
701 707
702 708 **Example**: An instance of the class ``MyClass`` will be able to access the
703 709 method ``cube()`` after it is uncommented and the file ``file1.py`` is saved on
704 710 disk.
705 711
706 712
707 713 .. code::
708 714
709 715 # notebook
710 716
711 717 from mymodule import MyClass
712 718 first = MyClass(5)
713 719
714 720 .. code::
715 721
716 722 # mymodule/file1.py
717 723
718 724 class MyClass:
719 725
720 726 def __init__(self, a=10):
721 727 self.a = a
722 728
723 729 def square(self):
724 730 print('compute square')
725 731 return self.a*self.a
726 732
727 733 # def cube(self):
728 734 # print('compute cube')
729 735 # return self.a*self.a*self.a
730 736
731 737
732 738
733 739
734 740 Misc
735 741 ----
736 742
737 743 The autoindent feature that was deprecated in 5.x was re-enabled and
738 744 un-deprecated in :ghpull:`11257`
739 745
740 746 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
741 747 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
742 748
743 749
744 750 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
745 751 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
746 752 the given code is non-zero (thus halting execution of further cells in a
747 753 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
748 754
749 755
750 756 Deprecations
751 757 ------------
752 758
753 759 A couple of unused functions and methods have been deprecated and will be removed
754 760 in future versions:
755 761
756 762 - ``IPython.utils.io.raw_print_err``
757 763 - ``IPython.utils.io.raw_print``
758 764
759 765
760 766 Backwards incompatible changes
761 767 ------------------------------
762 768
763 769 * The API for transforming input before it is parsed as Python code has been
764 770 completely redesigned: any custom input transformations will need to be
765 771 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
General Comments 0
You need to be logged in to leave comments. Login now