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