##// END OF EJS Templates
8.0 stats
Matthias Bussonnier -
Show More
@@ -1,475 +1,653 b''
1 ============
1 ============
2 8.x Series
2 8.x Series
3 ============
3 ============
4
4
5 IPython 8.0
5 IPython 8.0
6 -----------
6 -----------
7
7
8 IPython 8.0 is still in alpha/beta stage. Please help us improve those release notes
8 IPython 8.0 is still in alpha/beta stage. Please help us improve those release notes
9 by sending PRs that modify docs/source/whatsnew/version8.rst
9 by sending PRs that modify docs/source/whatsnew/version8.rst
10
10
11 IPython 8.0 is bringing a large number of new features and improvements to both the
11 IPython 8.0 is bringing a large number of new features and improvements to both the
12 user of the terminal and of the kernel via Jupyter. The removal of compatibility
12 user of the terminal and of the kernel via Jupyter. The removal of compatibility
13 with older version of Python is also the opportunity to do a couple of
13 with older version of Python is also the opportunity to do a couple of
14 performance improvement in particular with respect to startup time.
14 performance improvement in particular with respect to startup time.
15 The 8.x branch started diverging from its predecessor around IPython 7.12
15 The 8.x branch started diverging from its predecessor around IPython 7.12
16 (January 2020).
16 (January 2020).
17
17
18 This release contains 250+ Pull Requests, in addition to many of the features
18 This release contains 250+ Pull Requests, in addition to many of the features
19 and backports that have made it to the 7.x branch. All PRs that went into this
19 and backports that have made it to the 7.x branch. All PRs that went into this
20 released are properly tagged with the 8.0 milestone if you wish to have a more
20 released are properly tagged with the 8.0 milestone if you wish to have a more
21 in depth look at the changes.
21 in depth look at the changes.
22
22
23 Please fell free to send pull-requests to updates those notes after release,
23 Please fell free to send pull-requests to updates those notes after release,
24 I have likely forgotten a few things reviewing 250+ PRs.
24 I have likely forgotten a few things reviewing 250+ PRs.
25
25
26 Dependencies changes/downstream packaging
26 Dependencies changes/downstream packaging
27 -----------------------------------------
27 -----------------------------------------
28
28
29 Note that most of our building step have been changes to be (mostly) declarative
29 Note that most of our building step have been changes to be (mostly) declarative
30 and follow PEP 517, we are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
30 and follow PEP 517, we are trying to completely remove ``setup.py`` (:ghpull:`13238`) and are
31 looking for help to do so.
31 looking for help to do so.
32
32
33 - Minimum supported ``traitlets`` version if now 5+
33 - Minimum supported ``traitlets`` version if now 5+
34 - we now require ``stack_data``
34 - we now require ``stack_data``
35 - Minimal Python is now 3.8
35 - Minimal Python is now 3.8
36 - ``nose`` is not a testing requirement anymore
36 - ``nose`` is not a testing requirement anymore
37 - ``pytest`` replaces nose.
37 - ``pytest`` replaces nose.
38 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
38 - ``iptest``/``iptest3`` cli entrypoints do not exists anymore.
39 - minimum officially support ``numpy`` version has been bumped, but this should
39 - minimum officially support ``numpy`` version has been bumped, but this should
40 not have much effect on packaging.
40 not have much effect on packaging.
41
41
42
42
43 Deprecation and removal
43 Deprecation and removal
44 -----------------------
44 -----------------------
45
45
46 We removed almost all features, arguments, functions, and modules that were
46 We removed almost all features, arguments, functions, and modules that were
47 marked as deprecated between IPython 1.0 and 5.0. As reminder 5.0 was released
47 marked as deprecated between IPython 1.0 and 5.0. As reminder 5.0 was released
48 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in may 2020.
48 in 2016, and 1.0 in 2013. Last release of the 5 branch was 5.10.0, in may 2020.
49 The few remaining deprecated features we left have better deprecation warnings
49 The few remaining deprecated features we left have better deprecation warnings
50 or have been turned into explicit errors for better error messages.
50 or have been turned into explicit errors for better error messages.
51
51
52 I will use this occasion to add the following requests to anyone emitting a
52 I will use this occasion to add the following requests to anyone emitting a
53 deprecation warning:
53 deprecation warning:
54
54
55 - Please at at least ``stacklevel=2`` so that the warning is emitted into the
55 - Please at at least ``stacklevel=2`` so that the warning is emitted into the
56 caller context, and not the callee one.
56 caller context, and not the callee one.
57 - Please add **since which version** something is deprecated.
57 - Please add **since which version** something is deprecated.
58
58
59 As a side note it is much easier to deal with conditional comparing to versions
59 As a side note it is much easier to deal with conditional comparing to versions
60 numbers than ``try/except`` when a functionality change with version.
60 numbers than ``try/except`` when a functionality change with version.
61
61
62 I won't list all the removed features here, but modules like ``IPython.kernel``,
62 I won't list all the removed features here, but modules like ``IPython.kernel``,
63 which was just a shim module around ``ipykernel`` for the past 8 years have been
63 which was just a shim module around ``ipykernel`` for the past 8 years have been
64 remove, and so many other similar things that pre-date the name **Jupyter**
64 remove, and so many other similar things that pre-date the name **Jupyter**
65 itself.
65 itself.
66
66
67 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
67 We no longer need to add ``IPyhton.extensions`` to the PYTHONPATH because that is being
68 handled by ``load_extension``.
68 handled by ``load_extension``.
69
69
70 We are also removing ``Cythonmagic``, ``sympyprinting`` and ``rmagic`` as they are now in
70 We are also removing ``Cythonmagic``, ``sympyprinting`` and ``rmagic`` as they are now in
71 other packages and no longer need to be inside IPython.
71 other packages and no longer need to be inside IPython.
72
72
73
73
74 Documentation
74 Documentation
75 -------------
75 -------------
76
76
77 Majority of our docstrings have now been reformatted and automatically fixed by
77 Majority of our docstrings have now been reformatted and automatically fixed by
78 the experimental `Vélin <https://pypi.org/project/velin/>`_ project, to conform
78 the experimental `Vélin <https://pypi.org/project/velin/>`_ project, to conform
79 to numpydoc.
79 to numpydoc.
80
80
81 Type annotations
81 Type annotations
82 ----------------
82 ----------------
83
83
84 While IPython itself is highly dynamic and can't be completely typed, many of
84 While IPython itself is highly dynamic and can't be completely typed, many of
85 the function now have type annotation, and part of the codebase and now checked
85 the function now have type annotation, and part of the codebase and now checked
86 by mypy.
86 by mypy.
87
87
88
88
89 Featured changes
89 Featured changes
90 ----------------
90 ----------------
91
91
92 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
92 Here is a features list of changes in IPython 8.0. This is of course non-exhaustive.
93 Please note as well that many features have been added in the 7.x branch as well
93 Please note as well that many features have been added in the 7.x branch as well
94 (and hence why you want to read the 7.x what's new notes), in particular
94 (and hence why you want to read the 7.x what's new notes), in particular
95 features contributed by QuantStack (with respect to debugger protocol, and Xeus
95 features contributed by QuantStack (with respect to debugger protocol, and Xeus
96 Python), as well as many debugger features that I was please to implement as
96 Python), as well as many debugger features that I was please to implement as
97 part of my work at QuanSight and Sponsored by DE Shaw.
97 part of my work at QuanSight and Sponsored by DE Shaw.
98
98
99 Traceback improvements
99 Traceback improvements
100 ~~~~~~~~~~~~~~~~~~~~~~
100 ~~~~~~~~~~~~~~~~~~~~~~
101
101
102 Previously, error tracebacks for errors happening in code cells were showing a
102 Previously, error tracebacks for errors happening in code cells were showing a
103 hash, the one used for compiling the Python AST::
103 hash, the one used for compiling the Python AST::
104
104
105 In [1]: def foo():
105 In [1]: def foo():
106 ...: return 3 / 0
106 ...: return 3 / 0
107 ...:
107 ...:
108
108
109 In [2]: foo()
109 In [2]: foo()
110 ---------------------------------------------------------------------------
110 ---------------------------------------------------------------------------
111 ZeroDivisionError Traceback (most recent call last)
111 ZeroDivisionError Traceback (most recent call last)
112 <ipython-input-2-c19b6d9633cf> in <module>
112 <ipython-input-2-c19b6d9633cf> in <module>
113 ----> 1 foo()
113 ----> 1 foo()
114
114
115 <ipython-input-1-1595a74c32d5> in foo()
115 <ipython-input-1-1595a74c32d5> in foo()
116 1 def foo():
116 1 def foo():
117 ----> 2 return 3 / 0
117 ----> 2 return 3 / 0
118 3
118 3
119
119
120 ZeroDivisionError: division by zero
120 ZeroDivisionError: division by zero
121
121
122 The error traceback is now correctly formatted, showing the cell number in which the error happened::
122 The error traceback is now correctly formatted, showing the cell number in which the error happened::
123
123
124 In [1]: def foo():
124 In [1]: def foo():
125 ...: return 3 / 0
125 ...: return 3 / 0
126 ...:
126 ...:
127
127
128 Input In [2]: foo()
128 Input In [2]: foo()
129 ---------------------------------------------------------------------------
129 ---------------------------------------------------------------------------
130 ZeroDivisionError Traceback (most recent call last)
130 ZeroDivisionError Traceback (most recent call last)
131 input In [2], in <module>
131 input In [2], in <module>
132 ----> 1 foo()
132 ----> 1 foo()
133
133
134 Input In [1], in foo()
134 Input In [1], in foo()
135 1 def foo():
135 1 def foo():
136 ----> 2 return 3 / 0
136 ----> 2 return 3 / 0
137
137
138 ZeroDivisionError: division by zero
138 ZeroDivisionError: division by zero
139
139
140 The Second on is the integration of the ``stack_data`` package;
140 The Second on is the integration of the ``stack_data`` package;
141 which provide smarter informations in traceback; in particular it will highlight
141 which provide smarter informations in traceback; in particular it will highlight
142 the AST node where an error occurs which can help to quickly narrow down errors.
142 the AST node where an error occurs which can help to quickly narrow down errors.
143
143
144 For example in the following snippet::
144 For example in the following snippet::
145
145
146 def foo(i):
146 def foo(i):
147 x = [[[0]]]
147 x = [[[0]]]
148 return x[0][i][0]
148 return x[0][i][0]
149
149
150
150
151 def bar():
151 def bar():
152 return foo(0) + foo(
152 return foo(0) + foo(
153 1
153 1
154 ) + foo(2)
154 ) + foo(2)
155
155
156
156
157 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
157 Calling ``bar()`` would raise an ``IndexError`` on the return line of ``foo``,
158 IPython 8.0 is capable of telling you, where the index error occurs::
158 IPython 8.0 is capable of telling you, where the index error occurs::
159
159
160
160
161 IndexError
161 IndexError
162 Input In [2], in <module>
162 Input In [2], in <module>
163 ----> 1 bar()
163 ----> 1 bar()
164 ^^^^^
164 ^^^^^
165
165
166 Input In [1], in bar()
166 Input In [1], in bar()
167 6 def bar():
167 6 def bar():
168 ----> 7 return foo(0) + foo(
168 ----> 7 return foo(0) + foo(
169 ^^^^
169 ^^^^
170 8 1
170 8 1
171 ^^^^^^^^
171 ^^^^^^^^
172 9 ) + foo(2)
172 9 ) + foo(2)
173 ^^^^
173 ^^^^
174
174
175 Input In [1], in foo(i)
175 Input In [1], in foo(i)
176 1 def foo(i):
176 1 def foo(i):
177 2 x = [[[0]]]
177 2 x = [[[0]]]
178 ----> 3 return x[0][i][0]
178 ----> 3 return x[0][i][0]
179 ^^^^^^^
179 ^^^^^^^
180
180
181 Corresponding location marked here with ``^`` will show up highlighted in
181 Corresponding location marked here with ``^`` will show up highlighted in
182 terminal and notebooks.
182 terminal and notebooks.
183
183
184 The Third, which is the most discreet but can have a high impact on
184 The Third, which is the most discreet but can have a high impact on
185 productivity, a colon ``::`` and line number is appended after a filename in
185 productivity, a colon ``::`` and line number is appended after a filename in
186 traceback::
186 traceback::
187
187
188
188
189 ZeroDivisionError Traceback (most recent call last)
189 ZeroDivisionError Traceback (most recent call last)
190 File ~/error.py:4, in <module>
190 File ~/error.py:4, in <module>
191 1 def f():
191 1 def f():
192 2 1/0
192 2 1/0
193 ----> 4 f()
193 ----> 4 f()
194
194
195 File ~/error.py:2, in f()
195 File ~/error.py:2, in f()
196 1 def f():
196 1 def f():
197 ----> 2 1/0
197 ----> 2 1/0
198
198
199 Many terminal and editor have integrations allow to directly jump to the
199 Many terminal and editor have integrations allow to directly jump to the
200 relevant file/line when this syntax is used.
200 relevant file/line when this syntax is used.
201
201
202
202
203 Autosuggestons
203 Autosuggestons
204 ~~~~~~~~~~~~~~
204 ~~~~~~~~~~~~~~
205
205
206 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>`__.
206 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>`__.
207
207
208 `Ptpython <https://github.com/prompt-toolkit/ptpython#ptpython>`__ allows users to enable this feature in
208 `Ptpython <https://github.com/prompt-toolkit/ptpython#ptpython>`__ allows users to enable this feature in
209 `ptpython/config.py <https://github.com/prompt-toolkit/ptpython/blob/master/examples/ptpython_config/config.py#L90>`__.
209 `ptpython/config.py <https://github.com/prompt-toolkit/ptpython/blob/master/examples/ptpython_config/config.py#L90>`__.
210
210
211 This feature allows users to accept autosuggestions with ctrl e, ctrl f,
211 This feature allows users to accept autosuggestions with ctrl e, ctrl f,
212 or right arrow as described below.
212 or right arrow as described below.
213
213
214 1. Start ipython
214 1. Start ipython
215
215
216 .. image:: ../_images/8.0/auto_suggest_1_prompt_no_text.png
216 .. image:: ../_images/8.0/auto_suggest_1_prompt_no_text.png
217
217
218 2. Run ``print("hello")``
218 2. Run ``print("hello")``
219
219
220 .. image:: ../_images/8.0/auto_suggest_2_print_hello_suggest.png
220 .. image:: ../_images/8.0/auto_suggest_2_print_hello_suggest.png
221
221
222 3. start typing ``print`` again to see the autosuggestion
222 3. start typing ``print`` again to see the autosuggestion
223
223
224 .. image:: ../_images/8.0/auto_suggest_3_print_hello_suggest.png
224 .. image:: ../_images/8.0/auto_suggest_3_print_hello_suggest.png
225
225
226 4. Press ``ctrl-f``, or ``ctrl-e``, or ``right-arrow`` to accept the suggestion
226 4. Press ``ctrl-f``, or ``ctrl-e``, or ``right-arrow`` to accept the suggestion
227
227
228 .. image:: ../_images/8.0/auto_suggest_4_print_hello.png
228 .. image:: ../_images/8.0/auto_suggest_4_print_hello.png
229
229
230 You can also complete word by word:
230 You can also complete word by word:
231
231
232 1. Run ``def say_hello(): print("hello")``
232 1. Run ``def say_hello(): print("hello")``
233
233
234 .. image:: ../_images/8.0/auto_suggest_second_prompt.png
234 .. image:: ../_images/8.0/auto_suggest_second_prompt.png
235
235
236 2. Start typing the first letter if ``def`` to see the autosuggestion
236 2. Start typing the first letter if ``def`` to see the autosuggestion
237
237
238 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
238 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
239
239
240 3. Press ``alt-f`` (or ``escape`` followed by ``f``), to accept the first word of the suggestion
240 3. Press ``alt-f`` (or ``escape`` followed by ``f``), to accept the first word of the suggestion
241
241
242 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
242 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
243
243
244 Importantly, this feature does not interfere with tab completion:
244 Importantly, this feature does not interfere with tab completion:
245
245
246 1. After running ``def say_hello(): print("hello")``, press d
246 1. After running ``def say_hello(): print("hello")``, press d
247
247
248 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
248 .. image:: ../_images/8.0/auto_suggest_d_phantom.png
249
249
250 2. Press Tab to start tab completion
250 2. Press Tab to start tab completion
251
251
252 .. image:: ../_images/8.0/auto_suggest_d_completions.png
252 .. image:: ../_images/8.0/auto_suggest_d_completions.png
253
253
254 3A. Press Tab again to select the first option
254 3A. Press Tab again to select the first option
255
255
256 .. image:: ../_images/8.0/auto_suggest_def_completions.png
256 .. image:: ../_images/8.0/auto_suggest_def_completions.png
257
257
258 3B. Press ``alt f`` (``escape``, ``f``) to accept to accept the first word of the suggestion
258 3B. Press ``alt f`` (``escape``, ``f``) to accept to accept the first word of the suggestion
259
259
260 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
260 .. image:: ../_images/8.0/auto_suggest_def_phantom.png
261
261
262 3C. Press ``ctrl-f`` or ``ctrl-e`` to accept the entire suggestion
262 3C. Press ``ctrl-f`` or ``ctrl-e`` to accept the entire suggestion
263
263
264 .. image:: ../_images/8.0/auto_suggest_match_parens.png
264 .. image:: ../_images/8.0/auto_suggest_match_parens.png
265
265
266
266
267 Currently, autosuggestions are only shown in the emacs or vi insert editing modes:
267 Currently, autosuggestions are only shown in the emacs or vi insert editing modes:
268
268
269 - The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
269 - The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
270 - 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/>`__.
270 - 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/>`__.
271
271
272
272
273 Show pinfo information in ipdb using "?" and "??"
273 Show pinfo information in ipdb using "?" and "??"
274 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
274 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275
275
276 In IPDB, it is now possible to show the information about an object using "?"
276 In IPDB, it is now possible to show the information about an object using "?"
277 and "??", in much the same way it can be done when using the IPython prompt::
277 and "??", in much the same way it can be done when using the IPython prompt::
278
278
279 ipdb> partial?
279 ipdb> partial?
280 Init signature: partial(self, /, *args, **kwargs)
280 Init signature: partial(self, /, *args, **kwargs)
281 Docstring:
281 Docstring:
282 partial(func, *args, **keywords) - new function with partial application
282 partial(func, *args, **keywords) - new function with partial application
283 of the given arguments and keywords.
283 of the given arguments and keywords.
284 File: ~/.pyenv/versions/3.8.6/lib/python3.8/functools.py
284 File: ~/.pyenv/versions/3.8.6/lib/python3.8/functools.py
285 Type: type
285 Type: type
286 Subclasses:
286 Subclasses:
287
287
288 Previously, ``pinfo`` or ``pinfo2`` command had to be used for this purpose.
288 Previously, ``pinfo`` or ``pinfo2`` command had to be used for this purpose.
289
289
290
290
291 Autoreload 3 feature
291 Autoreload 3 feature
292 ~~~~~~~~~~~~~~~~~~~~
292 ~~~~~~~~~~~~~~~~~~~~
293
293
294 Example: When an IPython session is ran with the 'autoreload' extension loaded,
294 Example: When an IPython session is ran with the 'autoreload' extension loaded,
295 you will now have the option '3' to select which means the following:
295 you will now have the option '3' to select which means the following:
296
296
297 1. replicate all functionality from option 2
297 1. replicate all functionality from option 2
298 2. autoload all new funcs/classes/enums/globals from the module when they are added
298 2. autoload all new funcs/classes/enums/globals from the module when they are added
299 3. autoload all newly imported funcs/classes/enums/globals from external modules
299 3. autoload all newly imported funcs/classes/enums/globals from external modules
300
300
301 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``
301 Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload``
302
302
303 For more information please see the following unit test : ``extensions/tests/test_autoreload.py:test_autoload_newly_added_objects``
303 For more information please see the following unit test : ``extensions/tests/test_autoreload.py:test_autoload_newly_added_objects``
304
304
305 Auto formatting with black in the CLI
305 Auto formatting with black in the CLI
306 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307
307
308 If ``black`` is installed in the same environment as IPython, terminal IPython
308 If ``black`` is installed in the same environment as IPython, terminal IPython
309 will now *by default* reformat the code in the CLI when possible. You can
309 will now *by default* reformat the code in the CLI when possible. You can
310 disable this with ``--TerminalInteractiveShell.autoformatter=None``.
310 disable this with ``--TerminalInteractiveShell.autoformatter=None``.
311
311
312 This feature was present in 7.x but disabled by default.
312 This feature was present in 7.x but disabled by default.
313
313
314
314
315 History Range Glob feature
315 History Range Glob feature
316 ~~~~~~~~~~~~~~~~~~~~~~~~~~
316 ~~~~~~~~~~~~~~~~~~~~~~~~~~
317
317
318 Previously, when using ``%history``, users could specify either
318 Previously, when using ``%history``, users could specify either
319 a range of sessions and lines, for example:
319 a range of sessions and lines, for example:
320
320
321 .. code-block:: python
321 .. code-block:: python
322
322
323 ~8/1-~6/5 # see history from the first line of 8 sessions ago,
323 ~8/1-~6/5 # see history from the first line of 8 sessions ago,
324 # to the fifth line of 6 sessions ago.``
324 # to the fifth line of 6 sessions ago.``
325
325
326 Or users could specify a glob pattern:
326 Or users could specify a glob pattern:
327
327
328 .. code-block:: python
328 .. code-block:: python
329
329
330 -g <pattern> # glob ALL history for the specified pattern.
330 -g <pattern> # glob ALL history for the specified pattern.
331
331
332 However users could *not* specify both.
332 However users could *not* specify both.
333
333
334 If a user *did* specify both a range and a glob pattern,
334 If a user *did* specify both a range and a glob pattern,
335 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
335 then the glob pattern would be used (globbing *all* history) *and the range would be ignored*.
336
336
337 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.
337 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.
338
338
339 Don't start a multi line cell with sunken parenthesis
339 Don't start a multi line cell with sunken parenthesis
340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
341
341
342 From now on IPython will not ask for the next line of input when given a single
342 From now on IPython will not ask for the next line of input when given a single
343 line with more closing than opening brackets. For example, this means that if
343 line with more closing than opening brackets. For example, this means that if
344 you (mis)type ``]]`` instead of ``[]``, a ``SyntaxError`` will show up, instead of
344 you (mis)type ``]]`` instead of ``[]``, a ``SyntaxError`` will show up, instead of
345 the ``...:`` prompt continuation.
345 the ``...:`` prompt continuation.
346
346
347 IPython shell for ipdb interact
347 IPython shell for ipdb interact
348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349
349
350 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
350 The ipdb ``interact`` starts an IPython shell instead of Python's built-in ``code.interact()``.
351
351
352 Automatic Vi prompt stripping
352 Automatic Vi prompt stripping
353 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
354
354
355 When pasting code into IPython, it will strip the leading prompt characters if
355 When pasting code into IPython, it will strip the leading prompt characters if
356 there are any. For example, you can paste the following code into the console -
356 there are any. For example, you can paste the following code into the console -
357 it will still work, even though each line is prefixed with prompts (`In`,
357 it will still work, even though each line is prefixed with prompts (`In`,
358 `Out`)::
358 `Out`)::
359
359
360 In [1]: 2 * 2 == 4
360 In [1]: 2 * 2 == 4
361 Out[1]: True
361 Out[1]: True
362
362
363 In [2]: print("This still works as pasted")
363 In [2]: print("This still works as pasted")
364
364
365
365
366 Previously, this was not the case for the Vi-mode prompts::
366 Previously, this was not the case for the Vi-mode prompts::
367
367
368 In [1]: [ins] In [13]: 2 * 2 == 4
368 In [1]: [ins] In [13]: 2 * 2 == 4
369 ...: Out[13]: True
369 ...: Out[13]: True
370 ...:
370 ...:
371 File "<ipython-input-1-727bb88eaf33>", line 1
371 File "<ipython-input-1-727bb88eaf33>", line 1
372 [ins] In [13]: 2 * 2 == 4
372 [ins] In [13]: 2 * 2 == 4
373 ^
373 ^
374 SyntaxError: invalid syntax
374 SyntaxError: invalid syntax
375
375
376 This is now fixed, and Vi prompt prefixes - ``[ins]`` and ``[nav]`` - are
376 This is now fixed, and Vi prompt prefixes - ``[ins]`` and ``[nav]`` - are
377 skipped just as the normal ``In`` would be.
377 skipped just as the normal ``In`` would be.
378
378
379 IPython shell can be started in the Vi mode using ``ipython --TerminalInteractiveShell.editing_mode=vi``,
379 IPython shell can be started in the Vi mode using ``ipython --TerminalInteractiveShell.editing_mode=vi``,
380 You should be able to change mode dynamically with ``%config TerminalInteractiveShell.editing_mode='vi'``
380 You should be able to change mode dynamically with ``%config TerminalInteractiveShell.editing_mode='vi'``
381
381
382 Empty History Ranges
382 Empty History Ranges
383 ~~~~~~~~~~~~~~~~~~~~
383 ~~~~~~~~~~~~~~~~~~~~
384
384
385 A number of magics that take history ranges can now be used with an empty
385 A number of magics that take history ranges can now be used with an empty
386 range. These magics are:
386 range. These magics are:
387
387
388 * ``%save``
388 * ``%save``
389 * ``%load``
389 * ``%load``
390 * ``%pastebin``
390 * ``%pastebin``
391 * ``%pycat``
391 * ``%pycat``
392
392
393 Using them this way will make them take the history of the current session up
393 Using them this way will make them take the history of the current session up
394 to the point of the magic call (such that the magic itself will not be
394 to the point of the magic call (such that the magic itself will not be
395 included).
395 included).
396
396
397 Therefore it is now possible to save the whole history to a file using simple
397 Therefore it is now possible to save the whole history to a file using simple
398 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
398 ``%save <filename>``, load and edit it using ``%load`` (makes for a nice usage
399 when followed with :kbd:`F2`), send it to `dpaste.org <http://dpast.org>`_ using
399 when followed with :kbd:`F2`), send it to `dpaste.org <http://dpast.org>`_ using
400 ``%pastebin``, or view the whole thing syntax-highlighted with a single
400 ``%pastebin``, or view the whole thing syntax-highlighted with a single
401 ``%pycat``.
401 ``%pycat``.
402
402
403
403
404 Windows time-implementation: Switch to process_time
404 Windows time-implementation: Switch to process_time
405 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
405 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
406 Timing for example with ``%%time`` on windows is based on ``time.perf_counter``.
406 Timing for example with ``%%time`` on windows is based on ``time.perf_counter``.
407 This is at the end the same as W-All.
407 This is at the end the same as W-All.
408 To be a bit tighter to linux one could change to ``time.process_time`` instead.
408 To be a bit tighter to linux one could change to ``time.process_time`` instead.
409 Thus for example one would no longer count periods of sleep and further.
409 Thus for example one would no longer count periods of sleep and further.
410
410
411
411
412 Miscellaneous
412 Miscellaneous
413 ~~~~~~~~~~~~~
413 ~~~~~~~~~~~~~
414 - Non-text formatters are not disabled in terminal which should simplify
414 - Non-text formatters are not disabled in terminal which should simplify
415 writing extension displaying images or other mimetypes supporting terminals.
415 writing extension displaying images or other mimetypes supporting terminals.
416 :ghpull:`12315`
416 :ghpull:`12315`
417 -
417 -
418 - It is now possible to automatically insert matching brackets in Terminal IPython using the
418 - It is now possible to automatically insert matching brackets in Terminal IPython using the
419 ``TerminalInteractiveShell.auto_match=True`` option. :ghpull:`12586`
419 ``TerminalInteractiveShell.auto_match=True`` option. :ghpull:`12586`
420 - We are thinking of deprecating the current ``%%javascript`` magic in favor of a better replacement. See :ghpull:`13376`
420 - We are thinking of deprecating the current ``%%javascript`` magic in favor of a better replacement. See :ghpull:`13376`
421 - ``%time`` uses ``process_time`` instead of ``perf_counter``, see :ghpull:`12984`
421 - ``%time`` uses ``process_time`` instead of ``perf_counter``, see :ghpull:`12984`
422 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
422 - ``~`` is now expanded when part of a path in most magics :ghpull:`13385`
423 - ``%/%%timeit`` magic now adds comma every thousands to make reading long number easier :ghpull:`13379`
423 - ``%/%%timeit`` magic now adds comma every thousands to make reading long number easier :ghpull:`13379`
424 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
424 - ``"info"`` messages can now be customised to hide some fields :ghpull:`13343`
425 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
425 - ``collections.UserList`` now pretty-prints :ghpull:`13320`
426 - The debugger now have a persistent history, which should make it less
426 - The debugger now have a persistent history, which should make it less
427 annoying to retype commands :ghpull:`13246`
427 annoying to retype commands :ghpull:`13246`
428 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing, we
428 - ``!pip`` ``!conda`` ``!cd`` or ``!ls`` are likely doing the wrong thing, we
429 now warn users if they use it. :ghpull:`12954`
429 now warn users if they use it. :ghpull:`12954`
430 - make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
430 - make ``%precision`` work for ``numpy.float64`` type :ghpull:`12902`
431
431
432 Re-added support for XDG config directories
432 Re-added support for XDG config directories
433 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434
434
435 XDG support through the years did come an go, there is a tension between having
435 XDG support through the years did come an go, there is a tension between having
436 identical location in all platforms to have simple instructions. After initial
436 identical location in all platforms to have simple instructions. After initial
437 failure a couple of years ago IPython was modified to automatically migrate XDG
437 failure a couple of years ago IPython was modified to automatically migrate XDG
438 config files back into ``~/.ipython``, the migration code has now been removed.
438 config files back into ``~/.ipython``, the migration code has now been removed.
439 And IPython now check the XDG locations, so if you _manually_ move your config
439 And IPython now check the XDG locations, so if you _manually_ move your config
440 files to your preferred location, IPython will not move them back.
440 files to your preferred location, IPython will not move them back.
441
441
442
442
443 Numfocus Small Developer Grant
443 Numfocus Small Developer Grant
444 ------------------------------
444 ------------------------------
445
445
446 To prepare for Python 3.10 we have also started working on removing reliance and
446 To prepare for Python 3.10 we have also started working on removing reliance and
447 any dependency that is not Python 3.10 compatible; that include migrating our
447 any dependency that is not Python 3.10 compatible; that include migrating our
448 test suite to pytest, and starting to remove nose. This also mean that the
448 test suite to pytest, and starting to remove nose. This also mean that the
449 ``iptest`` command is now gone, and all testing is via pytest.
449 ``iptest`` command is now gone, and all testing is via pytest.
450
450
451 This was in large part thanks to the NumFOCUS Small Developer grant, which enabled us to
451 This was in large part thanks to the NumFOCUS Small Developer grant, which enabled us to
452 allocate \$4000 to hire `Nikita Kniazev (@Kojoley) <https://github.com/Kojoley>`_,
452 allocate \$4000 to hire `Nikita Kniazev (@Kojoley) <https://github.com/Kojoley>`_,
453 who did a fantastic job at updating our code base, migrating to pytest, pushing
453 who did a fantastic job at updating our code base, migrating to pytest, pushing
454 our coverage, and fixing a large number of bugs. I highly recommend contacting
454 our coverage, and fixing a large number of bugs. I highly recommend contacting
455 them if you need help with C++ and Python projects
455 them if you need help with C++ and Python projects
456
456
457 You can find all relevant issues and PRs with the SDG 2021 tag `<https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+>`__
457 You can find all relevant issues and PRs with the SDG 2021 tag `<https://github.com/ipython/ipython/issues?q=label%3A%22Numfocus+SDG+2021%22+>`__
458
458
459 Removing support for Older Python
459 Removing support for Older Python
460 ---------------------------------
460 ---------------------------------
461
461
462
462
463 We are also removing support for Python up to 3.7 allowing internal code to use more
463 We are also removing support for Python up to 3.7 allowing internal code to use more
464 efficient ``pathlib``, and make better use of type annotations.
464 efficient ``pathlib``, and make better use of type annotations.
465
465
466 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
466 .. image:: ../_images/8.0/pathlib_pathlib_everywhere.jpg
467 :alt: "Meme image of Toy Story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
467 :alt: "Meme image of Toy Story with Woody and Buzz, with the text 'pathlib, pathlib everywhere'"
468
468
469
469
470 We have about 34 PRs only to update some logic tu update some function from managing strings to
470 We have about 34 PRs only to update some logic to update some functions from managing strings to
471 using Pathlib.
471 using Pathlib.
472
472
473 The completer has also seen significant updates and make use of newer Jedi API
473 The completer has also seen significant updates and make use of newer Jedi API
474 offering faster and more reliable tab completion.
474 offering faster and more reliable tab completion.
475
475
476 Misc Statistics
477 ---------------
478
479 Here are some numbers:
480
481 7.x: 296 files, 12561 blank lines, 20282 comments, 35142 line of code.
482 8.0: 252 files, 12053 blank lines, 19232 comments, 34505 line of code.
483
484 $ git diff --stat 7.x...master | tail -1
485 340 files changed, 13399 insertions(+), 12421 deletions(-)
486
487 We have commits from 162 authors, who contributed 1916 commits in 23 month, excluding merges to not bias toward
488 maintainers pushing buttons.::
489
490 $ git shortlog -s --no-merges 7.x...master | sort -nr
491 535 Matthias Bussonnier
492 86 Nikita Kniazev
493 69 Blazej Michalik
494 49 Samuel Gaist
495 27 Itamar Turner-Trauring
496 18 Spas Kalaydzhisyki
497 17 Thomas Kluyver
498 17 Quentin Peter
499 17 James Morris
500 17 Artur Svistunov
501 15 Bart Skowron
502 14 Alex Hall
503 13 rushabh-v
504 13 Terry Davis
505 13 Benjamin Ragan-Kelley
506 8 martinRenou
507 8 farisachugthai
508 7 dswij
509 7 Gal B
510 7 Corentin Cadiou
511 6 yuji96
512 6 Martin Skarzynski
513 6 Justin Palmer
514 6 Daniel Goldfarb
515 6 Ben Greiner
516 5 Sammy Al Hashemi
517 5 Paul Ivanov
518 5 Inception95
519 5 Eyenpi
520 5 Douglas Blank
521 5 Coco Mishra
522 5 Bibo Hao
523 5 André A. Gomes
524 5 Ahmed Fasih
525 4 takuya fujiwara
526 4 palewire
527 4 Thomas A Caswell
528 4 Talley Lambert
529 4 Scott Sanderson
530 4 Ram Rachum
531 4 Nick Muoh
532 4 Nathan Goldbaum
533 4 Mithil Poojary
534 4 Michael T
535 4 Jakub Klus
536 4 Ian Castleden
537 4 Eli Rykoff
538 4 Ashwin Vishnu
539 3 谭九鼎
540 3 sleeping
541 3 Sylvain Corlay
542 3 Peter Corke
543 3 Paul Bissex
544 3 Matthew Feickert
545 3 Fernando Perez
546 3 Eric Wieser
547 3 Daniel Mietchen
548 3 Aditya Sathe
549 3 007vedant
550 2 rchiodo
551 2 nicolaslazo
552 2 luttik
553 2 gorogoroumaru
554 2 foobarbyte
555 2 bar-hen
556 2 Theo Ouzhinski
557 2 Strawkage
558 2 Samreen Zarroug
559 2 Pete Blois
560 2 Meysam Azad
561 2 Matthieu Ancellin
562 2 Mark Schmitz
563 2 Maor Kleinberger
564 2 MRCWirtz
565 2 Lumir Balhar
566 2 Julien Rabinow
567 2 Juan Luis Cano Rodríguez
568 2 Joyce Er
569 2 Jakub
570 2 Faris A Chugthai
571 2 Ethan Madden
572 2 Dimitri Papadopoulos
573 2 Diego Fernandez
574 2 Daniel Shimon
575 2 Coco Bennett
576 2 Carlos Cordoba
577 2 Boyuan Liu
578 2 BaoGiang HoangVu
579 2 Augusto
580 2 Arthur Svistunov
581 2 Arthur Moreira
582 2 Ali Nabipour
583 2 Adam Hackbarth
584 1 richard
585 1 linar-jether
586 1 lbennett
587 1 juacrumar
588 1 gpotter2
589 1 digitalvirtuoso
590 1 dalthviz
591 1 Yonatan Goldschmidt
592 1 Tomasz Kłoczko
593 1 Tobias Bengfort
594 1 Timur Kushukov
595 1 Thomas
596 1 Snir Broshi
597 1 Shao Yang Hong
598 1 Sanjana-03
599 1 Romulo Filho
600 1 Rodolfo Carvalho
601 1 Richard Shadrach
602 1 Reilly Tucker Siemens
603 1 Rakessh Roshan
604 1 Piers Titus van der Torren
605 1 PhanatosZou
606 1 Pavel Safronov
607 1 Paulo S. Costa
608 1 Paul McCarthy
609 1 NotWearingPants
610 1 Naelson Douglas
611 1 Michael Tiemann
612 1 Matt Wozniski
613 1 Markus Wageringel
614 1 Marcus Wirtz
615 1 Marcio Mazza
616 1 Lumír 'Frenzy' Balhar
617 1 Lightyagami1
618 1 Leon Anavi
619 1 LeafyLi
620 1 L0uisJ0shua
621 1 Kyle Cutler
622 1 Krzysztof Cybulski
623 1 Kevin Kirsche
624 1 KIU Shueng Chuan
625 1 Jonathan Slenders
626 1 Jay Qi
627 1 Jake VanderPlas
628 1 Iwan Briquemont
629 1 Hussaina Begum Nandyala
630 1 Gordon Ball
631 1 Gabriel Simonetto
632 1 Frank Tobia
633 1 Erik
634 1 Elliott Sales de Andrade
635 1 Daniel Hahler
636 1 Dan Green-Leipciger
637 1 Dan Green
638 1 Damian Yurzola
639 1 Coon, Ethan T
640 1 Carol Willing
641 1 Brian Lee
642 1 Brendan Gerrity
643 1 Blake Griffin
644 1 Bastian Ebeling
645 1 Bartosz Telenczuk
646 1 Ankitsingh6299
647 1 Andrew Port
648 1 Andrew J. Hesford
649 1 Albert Zhang
650 1 Adam Johnson
651
652 This does not of course represent non-code contributions.
653
General Comments 0
You need to be logged in to leave comments. Login now