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