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