Debian Codegraph @

docs/source/whatsnew/version6.rst

raw
1 ============
2 6.x Series
3 ============
4
5 .. _whatsnew650:
6
7 IPython 6.5.0
8 =============
9
10 Miscellaneous bug fixes and compatibility with Python 3.7.
11
12 * Autocompletion fix for modules with out ``__init__.py`` :ghpull:`11227`
13 * update the ``%pastebin`` magic to use ``dpaste.com`` instead og GitHub Gist
14 which now requires authentication :ghpull:`11182`
15 * Fix crash with multiprocessing :ghpull:`11185`
16
17 .. _whatsnew640:
18
19 IPython 6.4.0
20 =============
21
22 Everything new in :ref:`IPython 5.7 <whatsnew570>`
23
24 * Fix display object not emitting metadata :ghpull:`11106`
25 * Comments failing Jedi test :ghpull:`11110`
26
27
28 .. _whatsnew631:
29
30 IPython 6.3.1
31 =============
32
33 This is a bugfix release to switch the default completions back to IPython's
34 own completion machinery. We discovered some problems with the completions
35 from Jedi, including completing column names on pandas data frames.
36
37 You can switch the completions source with the config option
38 :configtrait:`Completer.use_jedi`.
39
40 .. _whatsnew630:
41
42 IPython 6.3
43 ===========
44
45 IPython 6.3 contains all the bug fixes and features in
46 :ref:`IPython 5.6 <whatsnew560>`. In addition:
47
48 * A new display class :class:`IPython.display.Code` can be used to display
49 syntax highlighted code in a notebook (:ghpull:`10978`).
50 * The :cellmagic:`html` magic now takes a ``--isolated`` option to put the
51 content in an iframe (:ghpull:`10962`).
52 * The code to find completions using the Jedi library has had various
53 adjustments. This is still a work in progress, but we hope this version has
54 fewer annoyances (:ghpull:`10956`, :ghpull:`10969`, :ghpull:`10999`,
55 :ghpull:`11035`, :ghpull:`11063`, :ghpull:`11065`).
56 * The *post* event callbacks are now always called, even when the execution failed
57 (for example because of a ``SyntaxError``).
58 * The execution info and result objects are now made available in the
59 corresponding *pre* or *post* ``*_run_cell`` :doc:`event callbacks </config/callbacks>`
60 in a backward compatible manner (:ghissue:`10774` and :ghpull:`10795`).
61 * Performance with very long code cells (hundreds of lines) is greatly improved
62 (:ghpull:`10898`). Further improvements are planned for IPython 7.
63
64 You can see all `pull requests for the 6.3 milestone
65 <https://github.com/ipython/ipython/pulls?utf8=%E2%9C%93&q=is%3Apr+milestone%3A6.3+is%3Aclosed>`__.
66
67 .. _whatsnew620:
68
69 IPython 6.2
70 ===========
71
72 IPython 6.2 contains all the bugs fixes and features :ref:`available in IPython 5.5 <whatsnew550>`,
73 like built in progress bar support, and system-wide configuration
74
75 The following features are specific to IPython 6.2:
76
77 Function signature in completions
78 ---------------------------------
79
80 Terminal IPython will now show the signature of the function while completing.
81 Only the currently highlighted function will show its signature on the line
82 below the completer by default. This functionality is recent, so it might be
83 limited; we welcome bug reports and requests for enhancements. :ghpull:`10507`
84
85 Assignments return values
86 -------------------------
87
88 IPython can now trigger the display hook on the last assignment of cells.
89 Up until 6.2 the following code wouldn't show the value of the assigned
90 variable::
91
92 In[1]: xyz = "something"
93 # nothing shown
94
95 You would have to actually make it the last statement::
96
97 In [2]: xyz = "something else"
98 ... : xyz
99 Out[2]: "something else"
100
101 With the option ``InteractiveShell.ast_node_interactivity='last_expr_or_assign'``
102 you can now do::
103
104 In [2]: xyz = "something else"
105 Out[2]: "something else"
106
107 This option can be toggled at runtime with the ``%config`` magic, and will
108 trigger on assignment ``a = 1``, augmented assignment ``+=``, ``-=``, ``|=`` ...
109 as well as type annotated assignments: ``a:int = 2``.
110
111 See :ghpull:`10598`
112
113 Recursive Call of ipdb
114 ----------------------
115
116 Advanced users of the debugger can now correctly recursively enter ipdb. This is
117 thanks to ``@segevfiner`` on :ghpull:`10721`.
118
119 .. _whatsnew610:
120
121 IPython 6.1
122 ===========
123
124 - Quotes in a filename are always escaped during tab-completion on non-Windows.
125 :ghpull:`10069`
126
127 - Variables now shadow magics in autocompletion. See :ghissue:`4877` and :ghpull:`10542`.
128
129 - Added the ability to add parameters to alias_magic. For example::
130
131 In [2]: %alias_magic hist history --params "-l 2" --line
132 Created `%hist` as an alias for `%history -l 2`.
133
134 In [3]: hist
135 %alias_magic hist history --params "-l 30" --line
136 %alias_magic hist history --params "-l 2" --line
137
138 Previously it was only possible to have an alias attached to a single function,
139 and you would have to pass in the given parameters every time::
140
141 In [4]: %alias_magic hist history --line
142 Created `%hist` as an alias for `%history`.
143
144 In [5]: hist -l 2
145 hist
146 %alias_magic hist history --line
147
148 - To suppress log state messages, you can now either use ``%logstart -q``, pass
149 ``--LoggingMagics.quiet=True`` on the command line, or set
150 ``c.LoggingMagics.quiet=True`` in your configuration file.
151
152 - An additional flag ``--TerminalInteractiveShell.term_title_format`` is
153 introduced to allow the user to control the format of the terminal title. It
154 is specified as a python format string, and currently the only variable it
155 will format is ``{cwd}``.
156
157 - ``??``/``%pinfo2`` will now show object docstrings if the source can't be retrieved. :ghpull:`10532`
158 - ``IPython.display`` has gained a ``%markdown`` cell magic. :ghpull:`10563`
159 - ``%config`` options can now be tab completed. :ghpull:`10555`
160 - ``%config`` with no arguments are now unique and sorted. :ghpull:`10548`
161 - Completion on keyword arguments does not duplicate ``=`` sign if already present. :ghpull:`10547`
162 - ``%run -m <module>`` now ``<module>`` passes extra arguments to ``<module>``. :ghpull:`10546`
163 - completer now understand "snake case auto complete": if ``foo_bar_kittens`` is
164 a valid completion, I can type ``f_b<tab>`` will complete to it. :ghpull:`10537`
165 - tracebacks are better standardized and will compress `/path/to/home` to `~`. :ghpull:`10515`
166
167 The following changes were also added to IPython 5.4, see :ref:`what's new in IPython 5.4 <whatsnew540>`
168 for more detail description:
169
170 - ``TerminalInteractiveShell`` is configurable and can be configured to
171 (re)-use the readline interface.
172
173 - objects can now define a ``_repr_mimebundle_``
174
175 - Execution heuristics improve for single line statements
176 - ``display()`` can now return a display id to update display areas.
177
178
179 .. _whatsnew600:
180
181 IPython 6.0
182 ===========
183
184 Released April 19th, 2017
185
186 IPython 6 features a major improvement in the completion machinery which is now
187 capable of completing non-executed code. It is also the first version of IPython
188 to stop compatibility with Python 2, which is still supported on the bugfix only
189 5.x branch. Read below for a non-exhaustive list of new features.
190
191 Make sure you have pip > 9.0 before upgrading.
192 You should be able to update by using:
193
194 .. code::
195
196 pip install ipython --upgrade
197
198
199 .. note::
200
201 If your pip version is greater than or equal to pip 9.0.1 you will automatically get
202 the most recent version of IPython compatible with your system: on Python 2 you
203 will get the latest IPython 5.x bugfix, while in Python 3
204 you will get the latest 6.x stable version.
205
206 New completion API and Interface
207 --------------------------------
208
209 The completer Completion API has seen an overhaul, and the new completer has
210 plenty of improvements both from the end users of terminal IPython and for
211 consumers of the API.
212
213 This new API is capable of pulling completions from :mod:`jedi`, thus allowing
214 type inference on non-executed code. If :mod:`jedi` is installed, completions like
215 the following are now possible without code evaluation:
216
217 >>> data = ['Number of users', 123_456]
218 ... data[0].<tab>
219
220 That is to say, IPython is now capable of inferring that `data[0]` is a string,
221 and will suggest completions like `.capitalize`. The completion power of IPython
222 will increase with new Jedi releases, and a number of bug-fixes and more completions
223 are already available on the development version of :mod:`jedi` if you are curious.
224
225 With the help of prompt toolkit, types of completions can be shown in the
226 completer interface:
227
228 .. image:: ../_images/jedi_type_inference_60.png
229 :alt: Jedi showing ability to do type inference
230 :align: center
231 :width: 400px
232 :target: ../_images/jedi_type_inference_60.png
233
234 The appearance of the completer is controlled by the
235 ``c.TerminalInteractiveShell.display_completions`` option that will show the
236 type differently depending on the value among ``'column'``, ``'multicolumn'``
237 and ``'readlinelike'``
238
239 The use of Jedi also fulfills a number of requests and fixes a number of bugs
240 like case-insensitive completion and completion after division operator: See
241 :ghpull:`10182`.
242
243 Extra patches and updates will be needed to the :mod:`ipykernel` package for
244 this feature to be available to other clients like Jupyter Notebook, Lab,
245 Nteract, Hydrogen...
246
247 The use of Jedi should be barely noticeable on recent machines, but
248 can be slower on older ones. To tweak the performance, the amount
249 of time given to Jedi to compute type inference can be adjusted with
250 ``c.IPCompleter.jedi_compute_type_timeout``. The objects whose type were not
251 inferred will be shown as ``<unknown>``. Jedi can also be completely deactivated
252 by using the ``c.Completer.use_jedi=False`` option.
253
254
255 The old ``Completer.complete()`` API is waiting deprecation and should be
256 replaced replaced by ``Completer.completions()`` in the near future. Feedback on
257 the current state of the API and suggestions are welcome.
258
259 Python 3 only codebase
260 ----------------------
261
262 One of the large challenges in IPython 6.0 has been the adoption of a pure
263 Python 3 codebase, which has led to upstream patches in pip,
264 pypi and warehouse to make sure Python 2 systems still upgrade to the latest
265 compatible Python version.
266
267 We remind our Python 2 users that IPython 5 is still compatible with Python 2.7,
268 still maintained and will get regular releases. Using pip 9+, upgrading IPython will
269 automatically upgrade to the latest version compatible with your system.
270
271 .. warning::
272
273 If you are on a system using an older version of pip on Python 2, pip may
274 still install IPython 6.0 on your system, and IPython will refuse to start.
275 You can fix this by upgrading pip, and reinstalling ipython, or forcing pip to
276 install an earlier version: ``pip install 'ipython<6'``
277
278 The ability to use only Python 3 on the code base of IPython brings a number
279 of advantages. Most of the newly written code make use of `optional function type
280 annotation <https://peps.python.org/pep-0484/>`_ leading to clearer code
281 and better documentation.
282
283 The total size of the repository has also decreased by about 1500 lines (for the
284 first time excluding the big split for 4.0). The decrease is potentially
285 a bit more for the sour as some documents like this one are append only and
286 are about 300 lines long.
287
288 The removal of the Python2/Python3 shim layer has made the code quite a lot clearer and
289 more idiomatic in a number of locations, and much friendlier to work with and
290 understand. We hope to further embrace Python 3 capabilities in the next release
291 cycle and introduce more of the Python 3 only idioms (yield from, kwarg only,
292 general unpacking) in the IPython code base, and see if we can take advantage
293 of these to improve user experience with better error messages and
294 hints.
295
296
297 Configurable TerminalInteractiveShell, readline interface
298 ---------------------------------------------------------
299
300 IPython gained a new ``c.TerminalIPythonApp.interactive_shell_class`` option
301 that allows customizing the class used to start the terminal frontend. This
302 should allow a user to use custom interfaces, like reviving the former readline
303 interface which is now a separate package not actively maintained by the core
304 team. See the project to bring back the readline interface: `rlipython
305 <https://github.com/ipython/rlipython>`_.
306
307 This change will be backported to the IPython 5.x series.
308
309 Misc improvements
310 -----------------
311
312
313 - The :cellmagic:`capture` magic can now capture the result of a cell (from
314 an expression on the last line), as well as printed and displayed output.
315 :ghpull:`9851`.
316
317 - Pressing Ctrl-Z in the terminal debugger now suspends IPython, as it already
318 does in the main terminal prompt.
319
320 - Autoreload can now reload ``Enum``. See :ghissue:`10232` and :ghpull:`10316`
321
322 - IPython.display has gained a :any:`GeoJSON <IPython.display.GeoJSON>` object.
323 :ghpull:`10288` and :ghpull:`10253`
324
325 Functions Deprecated in 6.x Development cycle
326 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327
328 - Loading extensions from ``ipython_extension_dir`` prints a warning that this
329 location is pending deprecation. This should only affect users still having
330 extensions installed with ``%install_ext`` which has been deprecated since
331 IPython 4.0, and removed in 5.0. Extensions still present in
332 ``ipython_extension_dir`` may shadow more recently installed versions using
333 pip. It is thus recommended to clean ``ipython_extension_dir`` of any
334 extension now available as a package.
335
336
337 - ``IPython.utils.warn`` was deprecated in IPython 4.0, and has now been removed.
338 instead of ``IPython.utils.warn`` inbuilt :mod:`warnings` module is used.
339
340
341 - The function `IPython.core.oinspect.py:call_tip` is unused, was marked as
342 deprecated (raising a `DeprecationWarning`) and marked for later removal.
343 :ghpull:`10104`
344
345 Backward incompatible changes
346 ------------------------------
347
348 Functions Removed in 6.x Development cycle
349 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
350
351 The following functions have been removed in the
352 development cycle marked for Milestone 6.0.
353
354 - ``IPython/utils/process.py`` - ``is_cmd_found``
355 - ``IPython/utils/process.py`` - ``pycmd2argv``
356
357 - The `--deep-reload` flag and the corresponding options to inject `dreload` or
358 `reload` into the interactive namespace have been removed. You have to
359 explicitly import `reload` from `IPython.lib.deepreload` to use it.
360
361 - The :magic:`profile` used to print the current IPython profile, and which
362 was deprecated in IPython 2.0 does now raise a `DeprecationWarning` error when
363 used. It is often confused with the :magic:`prun` and the deprecation removal
364 should free up the ``profile`` name in future versions.