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