##// END OF EJS Templates
fix wn
Matthias Bussonnier -
Show More
@@ -1,444 +1,467 b''
1 =====================
1 =====================
2 Development version
2 Development version
3 =====================
3 =====================
4
4
5 This document describes in-flight development work.
5 This document describes in-flight development work.
6
6
7 .. warning::
7 .. warning::
8
8
9 Please do not edit this file by hand (doing so will likely cause merge
9 Please do not edit this file by hand (doing so will likely cause merge
10 conflicts for other Pull Requests). Instead, create a new file in the
10 conflicts for other Pull Requests). Instead, create a new file in the
11 `docs/source/whatsnew/pr` folder
11 `docs/source/whatsnew/pr` folder
12
12
13
13
14 Released .... ...., 2019
14 Released .... ...., 2019
15
15
16
16
17 Need to be updated:
17 Need to be updated:
18
18
19 .. toctree::
19 .. toctree::
20 :maxdepth: 2
20 :maxdepth: 2
21 :glob:
21 :glob:
22
22
23 pr/*
23 pr/*
24
24
25 IPython 8.0 is bringing a large number of new features and improvements to both the
25 IPython 8.0 is bringing a large number of new features and improvements to both the
26 user of the terminal and of the kernel via Jupyter. The removal of compatibility
26 user of the terminal and of the kernel via Jupyter. The removal of compatibility
27 with older version of Python is also the opportunity to do a couple of
27 with older version of Python is also the opportunity to do a couple of
28 performance improvement in particular with respect to startup time.
28 performance improvement in particular with respect to startup time.
29 The 8.x branch started diverging from its predecessor around IPython 7.12
29 The 8.x branch started diverging from its predecessor around IPython 7.12
30 (January 2020).
30 (January 2020).
31
31
32 This release contains 250+ Pull Requests, in addition to many of the features
32 This release contains 250+ Pull Requests, in addition to many of the features
33 and backports that have made it to the 7.x branch. All PRs that went into this
33 and backports that have made it to the 7.x branch. All PRs that went into this
34 released are properly tagged with the 8.0 milestone if you wish to have a more
34 released are properly tagged with the 8.0 milestone if you wish to have a more
35 in depth look at the changes.
35 in depth look at the changes.
36
36
37 Please fell free to send pull-requests to updates those notes after release,
37 Please fell free to send pull-requests to updates those notes after release,
38 I have likely forgotten a few things reviewing 250+ PRs.
38 I have likely forgotten a few things reviewing 250+ PRs.
39
39
40 Dependencies changes/downstream packaging
40 Dependencies changes/downstream packaging
41 -----------------------------------------
41 -----------------------------------------
42
42
43 Note that most of our building step have been changes to be (mostly) declarative
43 Note that most of our building step have been changes to be (mostly) declarative
44 and follow PEP 517, we are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
44 and follow PEP 517, we are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
45 looking for help to do so.
45 looking for help to do so.
46
46
47 - Minimum supported ``traitlets`` version if now 5+
47 - Minimum supported ``traitlets`` version if now 5+
48 - we now require ``stack_data``
48 - we now require ``stack_data``
49 - Minimal Python is now 3.8
49 - Minimal Python is now 3.8
50 - ``nose`` is not a testing requirement anymore
50 - ``nose`` is not a testing requirement anymore
51 - ``pytest`` replaces nose.
51 - ``pytest`` replaces nose.
52 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
52 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
53 - minimum officially support ``numpy`` version has been bumped, but this should
53 - minimum officially support ``numpy`` version has been bumped, but this should
54 not have much effect on packaging.
54 not have much effect on packaging.
55
55
56
56
57 Deprecation and removal
57 Deprecation and removal
58 -----------------------
58 -----------------------
59
59
60 We removed almost all features, arguments, functions, and modules that were
60 We removed almost all features, arguments, functions, and modules that were
61 marked as deprecated between IPython 1.0 and 5.0. As reminder 5.0 was released
61 marked as deprecated between IPython 1.0 and 5.0. As reminder 5.0 was released
62 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in may 2020.
62 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in may 2020.
63 The few remaining deprecated features we left have better deprecation warnings
63 The few remaining deprecated features we left have better deprecation warnings
64 or have been turned into explicit errors for better error messages.
64 or have been turned into explicit errors for better error messages.
65
65
66 I will use this occasion to add the following requests to anyone emitting a
66 I will use this occasion to add the following requests to anyone emitting a
67 deprecation warning:
67 deprecation warning:
68
68
69 - Please at at least ``stacklevel=2`` so that the warning is emitted into the
69 - Please at at least ``stacklevel=2`` so that the warning is emitted into the
70 caller context, and not the callee one.
70 caller context, and not the callee one.
71 - Please add **since which version** something is deprecated.
71 - Please add **since which version** something is deprecated.
72
72
73 As a side note it is much easier to deal with conditional comparing to versions
73 As a side note it is much easier to deal with conditional comparing to versions
74 numbers than ``try/except`` when a functionality change with version.
74 numbers than ``try/except`` when a functionality change with version.
75
75
76 I won't list all the removed features here, but modules like ``IPython.kernel``,
76 I won't list all the removed features here, but modules like ``IPython.kernel``,
77 which was just a shim module around ``ipykernel`` for the past 8 years have been
77 which was just a shim module around ``ipykernel`` for the past 8 years have been
78 remove, and so many other similar things that pre-date the name **Jupyter**
78 remove, and so many other similar things that pre-date the name **Jupyter**
79 itself.
79 itself.
80
80
81 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
81 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
82 handled by ``load_extension``.
82 handled by ``load_extension``.
83
83
84 We are also removing ``Cythonmagic``, ``sympyprinting`` and ``rmagic`` as they are now in
84 We are also removing ``Cythonmagic``, ``sympyprinting`` and ``rmagic`` as they are now in
85 other packages and no longer need to be inside IPython.
85 other packages and no longer need to be inside IPython.
86
86
87
87
88 Documentation
88 Documentation
89 -------------
89 -------------
90
90
91 Majority of our docstrings have now been reformatted and automatically fixed by
91 Majority of our docstrings have now been reformatted and automatically fixed by
92 the experimental `VΓ©lin <https://pypi.org/project/velin/>`_ project, to conform
92 the experimental `VΓ©lin <https://pypi.org/project/velin/>`_ project, to conform
93 to numpydoc.
93 to numpydoc.
94
94
95 Type annotations
95 Type annotations
96 ----------------
96 ----------------
97
97
98 While IPython itself is highly dynamic and can't be completely typed, many of
98 While IPython itself is highly dynamic and can't be completely typed, many of
99 the function now have type annotation, and part of the codebase and now checked
99 the function now have type annotation, and part of the codebase and now checked
100 by mypy.
100 by mypy.
101
101
102
102
103 Featured changes
103 Featured changes
104 ----------------
104 ----------------
105
105
106 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
106 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
107 Please note as well that many features have been added in the 7.x branch as well
107 Please note as well that many features have been added in the 7.x branch as well
108 (and hence why you want to read the 7.x what's new notes), in particular
108 (and hence why you want to read the 7.x what's new notes), in particular
109 features contributed by QuantStack (with respect to debugger protocol, and Xeus
109 features contributed by QuantStack (with respect to debugger protocol, and Xeus
110 Python), as well as many debugger features that I was please to implement as
110 Python), as well as many debugger features that I was please to implement as
111 part of my work at QuanSight and Sponsored by DE Shaw.
111 part of my work at QuanSight and Sponsored by DE Shaw.
112
112
113 Better Tracebacks
113 Better Tracebacks
114 ~~~~~~~~~~~~~~~~~
114 ~~~~~~~~~~~~~~~~~
115
115
116 The first on is the integration of the ``stack_data`` package;
116 The first on is the integration of the ``stack_data`` package;
117 which provide smarter informations in traceback; in particular it will highlight
117 which provide smarter informations in traceback; in particular it will highlight
118 the AST node where an error occurs which can help to quickly narrow down errors.
118 the AST node where an error occurs which can help to quickly narrow down errors.
119
119
120 For example in the following snippet::
120 For example in the following snippet::
121
121
122 def foo(i):
122 def foo(i):
123 x = [[[0]]]
123 x = [[[0]]]
124 return x[0][i][0]
124 return x[0][i][0]
125
125
126
126
127 def bar():
127 def bar():
128 return foo(0) + foo(
128 return foo(0) + foo(
129 1
129 1
130 ) + foo(2)
130 ) + foo(2)
131
131
132
132
133 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
133 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
134 IPython 8.0 is capable of telling you, where the index error occurs::
134 IPython 8.0 is capable of telling you, where the index error occurs::
135
135
136 return x[0][i][0]
136
137 ^
137 IndexError
138 Input In [2], in <module>
139 ----> 1 bar()
140 ^^^^^
141
142 Input In [1], in bar()
143 6 def bar():
144 ----> 7 return foo(0) + foo(
145 ^^^^
146 8 1
147 ^^^^^^^^
148 9 ) + foo(2)
149 ^^^^
150
151 Input In [1], in foo(i)
152 1 def foo(i):
153 2 x = [[[0]]]
154 ----> 3 return x[0][i][0]
155 ^^^^^^^
156
157 Corresponding location marked here with ``^`` will show up highlighted in
158 terminal and notebooks.
159
160
138 Autosuggestons
161 Autosuggestons
139 ~~~~~~~~~~~~~~
162 ~~~~~~~~~~~~~~
140
163
141 Autosuggestion is a very useful feature available in `fish <https://fishshell.com/>`__, `zsh <https://en.wikipedia.org/wiki/Z_shell>`__, and `prompt-toolkit <https://python-prompt-toolkit.readthedocs.io/en/master/pages/asking_for_input.html#auto-suggestion>`__.
164 Autosuggestion is a very useful feature available in `fish <https://fishshell.com/>`__, `zsh <https://en.wikipedia.org/wiki/Z_shell>`__, and `prompt-toolkit <https://python-prompt-toolkit.readthedocs.io/en/master/pages/asking_for_input.html#auto-suggestion>`__.
142
165
143 `Ptpython <https://github.com/prompt-toolkit/ptpython#ptpython>`__ allows users to enable this feature in
166 `Ptpython <https://github.com/prompt-toolkit/ptpython#ptpython>`__ allows users to enable this feature in
144 `ptpython/config.py <https://github.com/prompt-toolkit/ptpython/blob/master/examples/ptpython_config/config.py#L90>`__.
167 `ptpython/config.py <https://github.com/prompt-toolkit/ptpython/blob/master/examples/ptpython_config/config.py#L90>`__.
145
168
146 This feature allows users to accept autosuggestions with ctrl e, ctrl f,
169 This feature allows users to accept autosuggestions with ctrl e, ctrl f,
147 or right arrow as described below.
170 or right arrow as described below.
148
171
149 1. Start ipython
172 1. Start ipython
150
173
151 .. image:: ../_images/8.0/auto_suggest_prompt_no_text.png
174 .. image:: ../_images/8.0/auto_suggest_prompt_no_text.png
152
175
153 2. Run ``print("hello")``
176 2. Run ``print("hello")``
154
177
155 .. image:: ../_images/8.0/auto_suggest_print_hello_suggest.png
178 .. image:: ../_images/8.0/auto_suggest_print_hello_suggest.png
156
179
157 3. Press p to see the autosuggestion
180 3. Press p to see the autosuggestion
158
181
159 .. image:: ../_images/8.0/auto_suggest_print_hello_suggest.png
182 .. image:: ../_images/8.0/auto_suggest_print_hello_suggest.png
160
183
161 4. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
184 4. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
162
185
163 .. image:: ../_images/8.0/auto_suggest_print_hello.png
186 .. image:: ../_images/8.0/auto_suggest_print_hello.png
164
187
165 You can also complete word by word:
188 You can also complete word by word:
166
189
167 1. Run ``def say_hello(): print("hello")``
190 1. Run ``def say_hello(): print("hello")``
168
191
169 .. image:: ../_images/8.0/auto_suggest_second_prompt.png
192 .. image:: ../_images/8.0/auto_suggest_second_prompt.png
170
193
171 2. Press d to see the autosuggestion
194 2. Press d to see the autosuggestion
172
195
173 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
196 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
174
197
175 3. Press alt f to accept the first word of the suggestion
198 3. Press alt f to accept the first word of the suggestion
176
199
177 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
200 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
178
201
179 Importantly, this feature does not interfere with tab completion:
202 Importantly, this feature does not interfere with tab completion:
180
203
181 1. After running ``def say_hello(): print("hello")``, press d
204 1. After running ``def say_hello(): print("hello")``, press d
182
205
183 .. image:: ../_images/8.0/audo_suggest_d_phantom.png
206 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
184
207
185 2. Press Tab to start tab completion
208 2. Press Tab to start tab completion
186
209
187 .. image:: ../_images/8.0/auto_suggest_d_completions.png
210 .. image:: ../_images/8.0/auto_suggest_d_completions.png
188
211
189 3A. Press Tab again to select the first option
212 3A. Press Tab again to select the first option
190
213
191 .. image:: ../_images/8.0/auto_suggest_def_completions.png
214 .. image:: ../_images/8.0/auto_suggest_def_completions.png
192
215
193 3B. Press alt f to accept to accept the first word of the suggestion
216 3B. Press alt f to accept to accept the first word of the suggestion
194
217
195 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
218 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
196
219
197 3C. Press ctrl f or ctrl e to accept the entire suggestion
220 3C. Press ctrl f or ctrl e to accept the entire suggestion
198
221
199 .. image:: ../_images/8.0/auto_suggest_match_parens.png
222 .. image:: ../_images/8.0/auto_suggest_match_parens.png
200
223
201 To install a version of ipython with autosuggestions enabled, run:
224 To install a version of ipython with autosuggestions enabled, run:
202
225
203 ``pip install git+https://github.com/mskar/ipython@auto_suggest``
226 ``pip install git+https://github.com/mskar/ipython@auto_suggest``
204
227
205 Currently, autosuggestions are only shown in the emacs or vi insert editing modes:
228 Currently, autosuggestions are only shown in the emacs or vi insert editing modes:
206
229
207 - The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
230 - The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
208 - To use these shortcuts in vi insert mode, you will have to create `custom keybindings in your config.py <https://github.com/mskar/setup/commit/2892fcee46f9f80ef7788f0749edc99daccc52f4/>`__.
231 - To use these shortcuts in vi insert mode, you will have to create `custom keybindings in your config.py <https://github.com/mskar/setup/commit/2892fcee46f9f80ef7788f0749edc99daccc52f4/>`__.
209
232
210
233
211 Show pinfo information in ipdb using "?" and "??"
234 Show pinfo information in ipdb using "?" and "??"
212 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213
236
214 In IPDB, it is now possible to show the information about an object using "?"
237 In IPDB, it is now possible to show the information about an object using "?"
215 and "??", in much the same way it can be done when using the IPython prompt::
238 and "??", in much the same way it can be done when using the IPython prompt::
216
239
217 ipdb> partial?
240 ipdb> partial?
218 Init signature: partial(self, /, *args, **kwargs)
241 Init signature: partial(self, /, *args, **kwargs)
219 Docstring:
242 Docstring:
220 partial(func, *args, **keywords) - new function with partial application
243 partial(func, *args, **keywords) - new function with partial application
221 of the given arguments and keywords.
244 of the given arguments and keywords.
222 File: ~/.pyenv/versions/3.8.6/lib/python3.8/functools.py
245 File: ~/.pyenv/versions/3.8.6/lib/python3.8/functools.py
223 Type: type
246 Type: type
224 Subclasses:
247 Subclasses:
225
248
226 Previously, "pinfo" or "pinfo2" command had to be used for this purpose.
249 Previously, "pinfo" or "pinfo2" command had to be used for this purpose.
227
250
228
251
229 Autoreload 3 feature
252 Autoreload 3 feature
230 ~~~~~~~~~~~~~~~~~~~~
253 ~~~~~~~~~~~~~~~~~~~~
231
254
232 Example: When an IPython session is ran with the 'autoreload' extension loaded,
255 Example: When an IPython session is ran with the 'autoreload' extension loaded,
233 you will now have the option '3' to select which means the following:
256 you will now have the option '3' to select which means the following:
234
257
235 1. replicate all functionality from option 2
258 1. replicate all functionality from option 2
236 2. autoload all new funcs/classes/enums/globals from the module when they're added
259 2. autoload all new funcs/classes/enums/globals from the module when they're added
237 3. autoload all newly imported funcs/classes/enums/globals from external modules
260 3. autoload all newly imported funcs/classes/enums/globals from external modules
238
261
239 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``
262 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``
240
263
241 For more information please see unit test -
264 For more information please see unit test -
242 extensions/tests/test_autoreload.py : 'test_autoload_newly_added_objects'
265 extensions/tests/test_autoreload.py : 'test_autoload_newly_added_objects'
243
266
244
267
245
268
246
269
247 History Range Glob feature
270 History Range Glob feature
248 ~~~~~~~~~~~~~~~~~~~~~~~~~~
271 ~~~~~~~~~~~~~~~~~~~~~~~~~~
249
272
250 Previously, when using ``%history``, users could specify either
273 Previously, when using ``%history``, users could specify either
251 a range of sessions and lines, for example:
274 a range of sessions and lines, for example:
252
275
253 .. code-block:: python
276 .. code-block:: python
254
277
255 ~8/1-~6/5 # see history from the first line of 8 sessions ago,
278 ~8/1-~6/5 # see history from the first line of 8 sessions ago,
256 # to the fifth line of 6 sessions ago.``
279 # to the fifth line of 6 sessions ago.``
257
280
258 Or users could specify a glob pattern:
281 Or users could specify a glob pattern:
259
282
260 .. code-block:: python
283 .. code-block:: python
261
284
262 -g <pattern> # glob ALL history for the specified pattern.
285 -g <pattern> # glob ALL history for the specified pattern.
263
286
264 However users could *not* specify both.
287 However users could *not* specify both.
265
288
266 If a user *did* specify both a range and a glob pattern,
289 If a user *did* specify both a range and a glob pattern,
267 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
290 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
268
291
269 With this enhancement, if a user specifies both a range and a glob pattern, then the glob pattern will be applied to the specified range of history.
292 With this enhancement, if a user specifies both a range and a glob pattern, then the glob pattern will be applied to the specified range of history.
270
293
271 Don't start a multi line cell with sunken parenthesis
294 Don't start a multi line cell with sunken parenthesis
272 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273
296
274 From now on IPython will not ask for the next line of input when given a single
297 From now on IPython will not ask for the next line of input when given a single
275 line with more closing than opening brackets. For example, this means that if
298 line with more closing than opening brackets. For example, this means that if
276 you (mis)type ']]' instead of '[]', a ``SyntaxError`` will show up, instead of
299 you (mis)type ']]' instead of '[]', a ``SyntaxError`` will show up, instead of
277 the ``...:`` prompt continuation.
300 the ``...:`` prompt continuation.
278
301
279 IPython shell for ipdb interact
302 IPython shell for ipdb interact
280 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
303 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
281
304
282 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
305 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
283
306
284 Automatic Vi prompt stripping
307 Automatic Vi prompt stripping
285 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
286
309
287 When pasting code into IPython, it will strip the leading prompt characters if
310 When pasting code into IPython, it will strip the leading prompt characters if
288 there are any. For example, you can paste the following code into the console -
311 there are any. For example, you can paste the following code into the console -
289 it will still work, even though each line is prefixed with prompts (`In`,
312 it will still work, even though each line is prefixed with prompts (`In`,
290 `Out`)::
313 `Out`)::
291
314
292 In [1]: 2 * 2 == 4
315 In [1]: 2 * 2 == 4
293 Out[1]: True
316 Out[1]: True
294
317
295 In [2]: print("This still works as pasted")
318 In [2]: print("This still works as pasted")
296
319
297
320
298 Previously, this was not the case for the Vi-mode prompts::
321 Previously, this was not the case for the Vi-mode prompts::
299
322
300 In [1]: [ins] In [13]: 2 * 2 == 4
323 In [1]: [ins] In [13]: 2 * 2 == 4
301 ...: Out[13]: True
324 ...: Out[13]: True
302 ...:
325 ...:
303 File "<ipython-input-1-727bb88eaf33>", line 1
326 File "<ipython-input-1-727bb88eaf33>", line 1
304 [ins] In [13]: 2 * 2 == 4
327 [ins] In [13]: 2 * 2 == 4
305 ^
328 ^
306 SyntaxError: invalid syntax
329 SyntaxError: invalid syntax
307
330
308 This is now fixed, and Vi prompt prefixes - ``[ins]`` and ``[nav]`` - are
331 This is now fixed, and Vi prompt prefixes - ``[ins]`` and ``[nav]`` - are
309 skipped just as the normal ``In`` would be.
332 skipped just as the normal ``In`` would be.
310
333
311 IPython shell can be started in the Vi mode using ``ipython
334 IPython shell can be started in the Vi mode using ``ipython
312 --TerminalInteractiveShell.editing_mode=vi``
335 --TerminalInteractiveShell.editing_mode=vi``
313
336
314 Empty History Ranges
337 Empty History Ranges
315 ~~~~~~~~~~~~~~~~~~~~
338 ~~~~~~~~~~~~~~~~~~~~
316
339
317 A number of magics that take history ranges can now be used with an empty
340 A number of magics that take history ranges can now be used with an empty
318 range. These magics are:
341 range. These magics are:
319
342
320 * ``%save``
343 * ``%save``
321 * ``%load``
344 * ``%load``
322 * ``%pastebin``
345 * ``%pastebin``
323 * ``%pycat``
346 * ``%pycat``
324
347
325 Using them this way will make them take the history of the current session up
348 Using them this way will make them take the history of the current session up
326 to the point of the magic call (such that the magic itself will not be
349 to the point of the magic call (such that the magic itself will not be
327 included).
350 included).
328
351
329 Therefore it is now possible to save the whole history to a file using simple
352 Therefore it is now possible to save the whole history to a file using simple
330 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
353 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
331 when followed with :kbd:`F2`), send it to dpaste.org using ``%pastebin``, or
354 when followed with :kbd:`F2`), send it to dpaste.org using ``%pastebin``, or
332 view the whole thing syntax-highlighted with a single ``%pycat``.
355 view the whole thing syntax-highlighted with a single ``%pycat``.
333
356
334 Traceback improvements
357 Traceback improvements
335 ~~~~~~~~~~~~~~~~~~~~~~
358 ~~~~~~~~~~~~~~~~~~~~~~
336
359
337
360
338 UPDATE THIS IN INPUT.
361 UPDATE THIS IN INPUT.
339
362
340 Previously, error tracebacks for errors happening in code cells were showing a hash, the one used for compiling the Python AST::
363 Previously, error tracebacks for errors happening in code cells were showing a hash, the one used for compiling the Python AST::
341
364
342 In [1]: def foo():
365 In [1]: def foo():
343 ...: return 3 / 0
366 ...: return 3 / 0
344 ...:
367 ...:
345
368
346 In [2]: foo()
369 In [2]: foo()
347 ---------------------------------------------------------------------------
370 ---------------------------------------------------------------------------
348 ZeroDivisionError Traceback (most recent call last)
371 ZeroDivisionError Traceback (most recent call last)
349 <ipython-input-2-c19b6d9633cf> in <module>
372 <ipython-input-2-c19b6d9633cf> in <module>
350 ----> 1 foo()
373 ----> 1 foo()
351
374
352 <ipython-input-1-1595a74c32d5> in foo()
375 <ipython-input-1-1595a74c32d5> in foo()
353 1 def foo():
376 1 def foo():
354 ----> 2 return 3 / 0
377 ----> 2 return 3 / 0
355 3
378 3
356
379
357 ZeroDivisionError: division by zero
380 ZeroDivisionError: division by zero
358
381
359 The error traceback is now correctly formatted, showing the cell number in which the error happened::
382 The error traceback is now correctly formatted, showing the cell number in which the error happened::
360
383
361 In [1]: def foo():
384 In [1]: def foo():
362 ...: return 3 / 0
385 ...: return 3 / 0
363 ...:
386 ...:
364
387
365 Input In [2]: foo()
388 Input In [2]: foo()
366 ---------------------------------------------------------------------------
389 ---------------------------------------------------------------------------
367 ZeroDivisionError Traceback (most recent call last)
390 ZeroDivisionError Traceback (most recent call last)
368 input In [2], in <module>
391 input In [2], in <module>
369 ----> 1 foo()
392 ----> 1 foo()
370
393
371 Input In [1], in foo()
394 Input In [1], in foo()
372 1 def foo():
395 1 def foo():
373 ----> 2 return 3 / 0
396 ----> 2 return 3 / 0
374
397
375 ZeroDivisionError: division by zero
398 ZeroDivisionError: division by zero
376
399
377 Miscellaneous
400 Miscellaneous
378 ~~~~~~~~~~~~~
401 ~~~~~~~~~~~~~
379
402
380 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
403 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
381 - ``%/%%timeit`` magic now adds comma every thousands to make reading long number easier :ghpull:`13379`
404 - ``%/%%timeit`` magic now adds comma every thousands to make reading long number easier :ghpull:`13379`
382 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
405 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
383 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
406 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
384 - The debugger now have a persistent history, which should make it less
407 - The debugger now have a persistent history, which should make it less
385 annoying to retype commands :ghpull:`13246`
408 annoying to retype commands :ghpull:`13246`
386 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing, we
409 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing, we
387 now warn users if they use it. :ghpull:`12954`
410 now warn users if they use it. :ghpull:`12954`
388 - make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
411 - make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
389
412
390
413
391
414
392
415
393 Numfocus Small Developer Grant
416 Numfocus Small Developer Grant
394 ------------------------------
417 ------------------------------
395
418
396 To prepare for Python 3.10 we have also started working on removing reliance and
419 To prepare for Python 3.10 we have also started working on removing reliance and
397 any dependency that is not Python 3.10 compatible; that include migrating our
420 any dependency that is not Python 3.10 compatible; that include migrating our
398 test suite to pytest, and starting to remove nose. This also mean that the
421 test suite to pytest, and starting to remove nose. This also mean that the
399 ``iptest`` command is now gone, and all testing is via pytest.
422 ``iptest`` command is now gone, and all testing is via pytest.
400
423
401 This was in bog part thanks the NumFOCUS Small Developer grant, we were able to
424 This was in bog part thanks the NumFOCUS Small Developer grant, we were able to
402 allocate 4000 to hire `Nikita Kniazev @Kojoley <https://github.com/Kojoley>`__
425 allocate 4000 to hire `Nikita Kniazev @Kojoley <https://github.com/Kojoley>`__
403 who did a fantastic job at updating our code base, migrating to pytest, pushing
426 who did a fantastic job at updating our code base, migrating to pytest, pushing
404 our coverage, and fixing a large number of bugs. I highly recommend contacting
427 our coverage, and fixing a large number of bugs. I highly recommend contacting
405 them if you need help with C++ and Python projects
428 them if you need help with C++ and Python projects
406
429
407 You can find all relevant issues and PRs with the SDG 2021 tag:
430 You can find all relevant issues and PRs with the SDG 2021 tag:
408
431
409 https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+
432 https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+
410
433
411 Removing support for Older Python
434 Removing support for Older Python
412 ---------------------------------
435 ---------------------------------
413
436
414
437
415 We are also removing support for Python up to 3.7 allowing internal code to use more
438 We are also removing support for Python up to 3.7 allowing internal code to use more
416 efficient ``pathlib``, and make better use of type annotations.
439 efficient ``pathlib``, and make better use of type annotations.
417
440
418 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
441 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
419 :alt: "Meme image of Toy story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
442 :alt: "Meme image of Toy story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
420
443
421
444
422 IMAGE : Pathlib, pathlib everywhere.
445 IMAGE : Pathlib, pathlib everywhere.
423
446
424 We have about 34 PRs only to update some logic tu update some function from managing strings to
447 We have about 34 PRs only to update some logic tu update some function from managing strings to
425 using Pathlib.
448 using Pathlib.
426
449
427 The completer has also seen significant updates and make use of newer Jedi API
450 The completer has also seen significant updates and make use of newer Jedi API
428 offering faster and more reliable tab completion.
451 offering faster and more reliable tab completion.
429
452
430 For the terminal users this also enable the auto-suggestion feature, described
453 For the terminal users this also enable the auto-suggestion feature, described
431 below, which show "ghost text" ahead of your cursor you can accept without
454 below, which show "ghost text" ahead of your cursor you can accept without
432 having to press the tab key or ask the completer to suggest completions.
455 having to press the tab key or ask the completer to suggest completions.
433
456
434
457
435
458
436 .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT.
459 .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT.
437
460
438 As a reminder, IPython master has diverged from the 7.x branch, thus master may
461 As a reminder, IPython master has diverged from the 7.x branch, thus master may
439 have more feature and API changes.
462 have more feature and API changes.
440
463
441 Backwards incompatible changes
464 Backwards incompatible changes
442 ------------------------------
465 ------------------------------
443
466
444 .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT.
467 .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT.
General Comments 0
You need to be logged in to leave comments. Login now