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