Show More
@@ -1,190 +1,190 b'' | |||||
1 | IPython 6.0 |
|
1 | IPython 6.0 | |
2 | =========== |
|
2 | =========== | |
3 |
|
3 | |||
4 | Released .... ...., 2017 |
|
4 | Released .... ...., 2017 | |
5 |
|
5 | |||
6 | IPython 6 feature a major improvement in the completion machinery which is now |
|
6 | IPython 6 feature a major improvement in the completion machinery which is now | |
7 | capable of completing non-executed code. It is also the first version of IPython |
|
7 | capable of completing non-executed code. It is also the first version of IPython | |
8 | to stop compatibility with Python 2, which is still supported on the bugfix only |
|
8 | to stop compatibility with Python 2, which is still supported on the bugfix only | |
9 | 5.x branch. Read below to have a non-exhaustive list of new features. |
|
9 | 5.x branch. Read below to have a non-exhaustive list of new features. | |
10 |
|
10 | |||
11 | Make sure you have pip > 9.0 before upgrading. |
|
11 | Make sure you have pip > 9.0 before upgrading. | |
12 | You should be able to update by using: |
|
12 | You should be able to update by using: | |
13 |
|
13 | |||
14 | .. code:: |
|
14 | .. code:: | |
15 |
|
15 | |||
16 | pip install ipython --upgrade |
|
16 | pip install ipython --upgrade | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | .. note:: |
|
19 | .. note:: | |
20 |
|
20 | |||
21 | If your pip version is greater of equal to pip 9.0.1 you will automatically get |
|
21 | If your pip version is greater of equal to pip 9.0.1 you will automatically get | |
22 |
the most recent version of IPython compatible with your system |
|
22 | the most recent version of IPython compatible with your system: on Python 2 you | |
23 |
|
|
23 | will get the latest IPython 5.x bugfix, while in Python 3 | |
24 | you will get the latest 6.x stable version. |
|
24 | you will get the latest 6.x stable version. | |
25 |
|
25 | |||
26 | New completion API and Interface |
|
26 | New completion API and Interface | |
27 | -------------------------------- |
|
27 | -------------------------------- | |
28 |
|
28 | |||
29 | The completer Completion API has seen an overhaul, and the new completer have |
|
29 | The completer Completion API has seen an overhaul, and the new completer have | |
30 | plenty of improvement both from the end users of terminal IPython or for |
|
30 | plenty of improvement both from the end users of terminal IPython or for | |
31 | consumers of the API. |
|
31 | consumers of the API. | |
32 |
|
32 | |||
33 | This new API is capable of pulling completions from :any:`jedi`, thus allowing |
|
33 | This new API is capable of pulling completions from :any:`jedi`, thus allowing | |
34 | type inference on non-executed code. If :any:`jedi` is installed completion like |
|
34 | type inference on non-executed code. If :any:`jedi` is installed completion like | |
35 | the following are now becoming possible without code evaluation: |
|
35 | the following are now becoming possible without code evaluation: | |
36 |
|
36 | |||
37 | >>> data = ['Number of users', 123_456] |
|
37 | >>> data = ['Number of users', 123_456] | |
38 | ... data[0].<tab> |
|
38 | ... data[0].<tab> | |
39 |
|
39 | |||
40 | That is to say, IPython is now capable of inferring that `data[0]` is a string, |
|
40 | That is to say, IPython is now capable of inferring that `data[0]` is a string, | |
41 | and will suggest completions like `.capitalize`. The completion power of IPython |
|
41 | and will suggest completions like `.capitalize`. The completion power of IPython | |
42 | will increase with new Jedi releases, and a number of bugs and more completions |
|
42 | will increase with new Jedi releases, and a number of bugs and more completions | |
43 | are already available on development version of :any:`jedi` if you are curious. |
|
43 | are already available on the development version of :any:`jedi` if you are curious. | |
44 |
|
44 | |||
45 | With the help of prompt toolkit, types of completions can be shown in the |
|
45 | With the help of prompt toolkit, types of completions can be shown in the | |
46 | completer interface: |
|
46 | completer interface: | |
47 |
|
47 | |||
48 | .. image:: ../_images/jedi_type_inference_60.png |
|
48 | .. image:: ../_images/jedi_type_inference_60.png | |
49 | :alt: Jedi showing ability to do type inference |
|
49 | :alt: Jedi showing ability to do type inference | |
50 | :align: center |
|
50 | :align: center | |
51 | :width: 400px |
|
51 | :width: 400px | |
52 | :target: ../_images/jedi_type_inference_60.png |
|
52 | :target: ../_images/jedi_type_inference_60.png | |
53 |
|
53 | |||
54 | The appearance of the completer is controlled by the |
|
54 | The appearance of the completer is controlled by the | |
55 | ``c.TerminalInteractiveShell.display_completions`` option that will show the |
|
55 | ``c.TerminalInteractiveShell.display_completions`` option that will show the | |
56 | type differently depending on the value among ``'column'``, ``'multicolumn'`` |
|
56 | type differently depending on the value among ``'column'``, ``'multicolumn'`` | |
57 | and ``'readlinelike'`` |
|
57 | and ``'readlinelike'`` | |
58 |
|
58 | |||
59 |
The use of Jedi also ful |
|
59 | The use of Jedi also fulfills a number of requests and fix a number of bugs | |
60 |
like case |
|
60 | like case-insensitive completion, completion after division operator: See | |
61 | :ghpull:`10182`. |
|
61 | :ghpull:`10182`. | |
62 |
|
62 | |||
63 | Extra patches and updates will be needed to the :mod:`ipykernel` package for |
|
63 | Extra patches and updates will be needed to the :mod:`ipykernel` package for | |
64 |
this feature to be available to other clients like |
|
64 | this feature to be available to other clients like Jupyter Notebook, Lab, | |
65 | Nteract, Hydrogen... |
|
65 | Nteract, Hydrogen... | |
66 |
|
66 | |||
67 |
The use of Jedi |
|
67 | The use of Jedi is should be barely noticeable on recent enough machines, but | |
68 | feel on older ones, in cases were Jedi behavior need to be adjusted, the amount |
|
68 | can be slower on older ones. To tweak the performances, the amount | |
69 | of time given to Jedi to compute type inference can be adjusted with |
|
69 | of time given to Jedi to compute type inference can be adjusted with | |
70 |
``c.IPCompleter.jedi_compute_type_timeout`` |
|
70 | ``c.IPCompleter.jedi_compute_type_timeout``. The objects whose type were not | |
71 | inferred will be shown as ``<unknown>``. Jedi can also be completely deactivated |
|
71 | inferred will be shown as ``<unknown>``. Jedi can also be completely deactivated | |
72 | by using the ``c.Completer.use_jedi=False`` option. |
|
72 | by using the ``c.Completer.use_jedi=False`` option. | |
73 |
|
73 | |||
74 |
|
74 | |||
75 | The old ``Completer.complete()`` API is waiting deprecation and should be |
|
75 | The old ``Completer.complete()`` API is waiting deprecation and should be | |
76 | replaced replaced by ``Completer.completions()`` in a near future. Feedback on |
|
76 | replaced replaced by ``Completer.completions()`` in a near future. Feedback on | |
77 | the current state of the API and suggestions welcome. |
|
77 | the current state of the API and suggestions welcome. | |
78 |
|
78 | |||
79 | Python 3 only codebase |
|
79 | Python 3 only codebase | |
80 | ---------------------- |
|
80 | ---------------------- | |
81 |
|
81 | |||
82 | One of the large challenges in IPython 6.0 has been the adoption of a pure |
|
82 | One of the large challenges in IPython 6.0 has been the adoption of a pure | |
83 |
Python 3 code |
|
83 | Python 3 codebase, which leads us to great length to upstream patches in pip, | |
84 | pypi and warehouse to make sure Python 2 system still upgrade to the latest |
|
84 | pypi and warehouse to make sure Python 2 system still upgrade to the latest | |
85 | compatible Python version compatible. |
|
85 | compatible Python version compatible. | |
86 |
|
86 | |||
87 | We remind our Python 2 users that IPython 5 is still compatible with Python 2.7, |
|
87 | We remind our Python 2 users that IPython 5 is still compatible with Python 2.7, | |
88 | still maintained and get regular releases. Using pip 9+, upgrading IPython will |
|
88 | still maintained and get regular releases. Using pip 9+, upgrading IPython will | |
89 | automatically upgrade to the latest version compatible with your system. |
|
89 | automatically upgrade to the latest version compatible with your system. | |
90 |
|
90 | |||
91 | .. warning:: |
|
91 | .. warning:: | |
92 |
|
92 | |||
93 |
If you are on a system using an older ver |
|
93 | If you are on a system using an older version of pip on Python 2, pip may | |
94 | still install IPython 6.0 on your system, and IPython will refuse to start. |
|
94 | still install IPython 6.0 on your system, and IPython will refuse to start. | |
95 | You can fix this by ugrading pip, and reinstalling ipython, or forcing pip to |
|
95 | You can fix this by upgrading pip, and reinstalling ipython, or forcing pip to | |
96 | install an earlier version: ``pip install 'ipython<6'`` |
|
96 | install an earlier version: ``pip install 'ipython<6'`` | |
97 |
|
97 | |||
98 |
The ability to use only Python 3 on the code base of IPython |
|
98 | The ability to use only Python 3 on the code base of IPython brings a number | |
99 | of advantage. Most of the newly written code make use of `optional function type |
|
99 | of advantage. Most of the newly written code make use of `optional function type | |
100 | anotation <https://www.python.org/dev/peps/pep-0484/>`_ leading to clearer code |
|
100 | annotation <https://www.python.org/dev/peps/pep-0484/>`_ leading to clearer code | |
101 | and better documentation. |
|
101 | and better documentation. | |
102 |
|
102 | |||
103 |
The total size of the repository has also |
|
103 | The total size of the repository has also decreased by about 1500 lines (for the | |
104 |
|
|
104 | first time excluding the big split for 4.0). The decrease is potentially | |
105 |
|
|
105 | a bit more for the sour as some documents like this one are append only and | |
106 | are about 300 lines long. |
|
106 | are about 300 lines long. | |
107 |
|
107 | |||
108 | The removal as of Python2/Python3 shim layer has made the code quite clearer and |
|
108 | The removal as of Python2/Python3 shim layer has made the code quite clearer and | |
109 | more idiomatic in a number of location, and much friendlier to work with and |
|
109 | more idiomatic in a number of location, and much friendlier to work with and | |
110 | understand. We hope to further embrace Python 3 capability in the next release |
|
110 | understand. We hope to further embrace Python 3 capability in the next release | |
111 | cycle and introduce more of the Python 3 only idioms (yield from, kwarg only, |
|
111 | cycle and introduce more of the Python 3 only idioms (yield from, kwarg only, | |
112 | general unpacking) in the code base of IPython, and see if we can take advantage |
|
112 | general unpacking) in the code base of IPython, and see if we can take advantage | |
113 | of these as well to improve user experience with better error messages and |
|
113 | of these as well to improve user experience with better error messages and | |
114 | hints. |
|
114 | hints. | |
115 |
|
115 | |||
116 |
|
116 | |||
117 | Configurable TerminalInteractiveShell, readline interface |
|
117 | Configurable TerminalInteractiveShell, readline interface | |
118 | --------------------------------------------------------- |
|
118 | --------------------------------------------------------- | |
119 |
|
119 | |||
120 | IPython gained a new ``c.TerminalIPythonApp.interactive_shell_class`` option |
|
120 | IPython gained a new ``c.TerminalIPythonApp.interactive_shell_class`` option | |
121 |
that allow |
|
121 | that allows customizing the class used to start the terminal frontend. This | |
122 | should allow user to use custom interfaces, like reviving the former readline |
|
122 | should allow a user to use custom interfaces, like reviving the former readline | |
123 | interface which is now a separate package not actively maintained by the core |
|
123 | interface which is now a separate package not actively maintained by the core | |
124 | team. See the project to bring back the readline interface: `rlipython |
|
124 | team. See the project to bring back the readline interface: `rlipython | |
125 | <https://github.com/ipython/rlipython>`_. |
|
125 | <https://github.com/ipython/rlipython>`_. | |
126 |
|
126 | |||
127 | This change will be backported to the IPython 5.x series. |
|
127 | This change will be backported to the IPython 5.x series. | |
128 |
|
128 | |||
129 |
|
129 | |||
130 | Miscs improvements |
|
130 | Miscs improvements | |
131 | ------------------ |
|
131 | ------------------ | |
132 |
|
132 | |||
133 |
|
133 | |||
134 |
- The :cellmagic:`capture` magic can now capture the result of a cell (from |
|
134 | - The :cellmagic:`capture` magic can now capture the result of a cell (from | |
135 | expression on the last line), as well as printed and displayed output. |
|
135 | an expression on the last line), as well as printed and displayed output. | |
136 | :ghpull:`9851`. |
|
136 | :ghpull:`9851`. | |
137 |
|
137 | |||
138 | - Pressing Ctrl-Z in the terminal debugger now suspends IPython, as it already |
|
138 | - Pressing Ctrl-Z in the terminal debugger now suspends IPython, as it already | |
139 | does in the main terminal prompt. |
|
139 | does in the main terminal prompt. | |
140 |
|
140 | |||
141 | - autoreload can now reload ``Enum``. See :ghissue:`10232` and :ghpull:`10316` |
|
141 | - autoreload can now reload ``Enum``. See :ghissue:`10232` and :ghpull:`10316` | |
142 |
|
142 | |||
143 | - IPython.display has gained a :any:`GeoJSON <IPython.display.GeoJSON>` object. |
|
143 | - IPython.display has gained a :any:`GeoJSON <IPython.display.GeoJSON>` object. | |
144 | :ghpull:`10288` and :ghpull:`10253` |
|
144 | :ghpull:`10288` and :ghpull:`10253` | |
145 |
|
145 | |||
146 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. |
|
146 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. | |
147 |
|
147 | |||
148 |
|
148 | |||
149 | Functions Deprecated in 6.x Development cycle |
|
149 | Functions Deprecated in 6.x Development cycle | |
150 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
150 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
151 |
|
151 | |||
152 | - Loading extensions from ``ipython_extension_dir`` print a warning that this |
|
152 | - Loading extensions from ``ipython_extension_dir`` print a warning that this | |
153 | location is pending deprecation. This should only affect users still having |
|
153 | location is pending deprecation. This should only affect users still having | |
154 | extensions installed with ``%install_ext`` which has been deprecated since |
|
154 | extensions installed with ``%install_ext`` which has been deprecated since | |
155 | IPython 4.0, and removed in 5.0. Extensions still present in |
|
155 | IPython 4.0, and removed in 5.0. Extensions still present in | |
156 | ``ipython_extension_dir`` may shadow more recently installed versions using |
|
156 | ``ipython_extension_dir`` may shadow more recently installed versions using | |
157 | pip. It is thus recommended to clean ``ipython_extension_dir`` of any |
|
157 | pip. It is thus recommended to clean ``ipython_extension_dir`` of any | |
158 | extension now available as a package. |
|
158 | extension now available as a package. | |
159 |
|
159 | |||
160 |
|
160 | |||
161 | - ``IPython.utils.warn`` was deprecated in IPython 4.0, and has now been removed. |
|
161 | - ``IPython.utils.warn`` was deprecated in IPython 4.0, and has now been removed. | |
162 | instead of ``IPython.utils.warn`` inbuilt :any:`warnings` module is used. |
|
162 | instead of ``IPython.utils.warn`` inbuilt :any:`warnings` module is used. | |
163 |
|
163 | |||
164 |
|
164 | |||
165 | - The function `IPython.core.oinspect.py:call_tip` is unused, was marked as |
|
165 | - The function `IPython.core.oinspect.py:call_tip` is unused, was marked as | |
166 | Deprecated (raising a Deprecation Warning) and marked for later removal |
|
166 | Deprecated (raising a Deprecation Warning) and marked for later removal | |
167 | :ghpull:`10104` |
|
167 | :ghpull:`10104` | |
168 |
|
168 | |||
169 |
Backward |
|
169 | Backward incompatible changes | |
170 | ------------------------------ |
|
170 | ------------------------------ | |
171 |
|
171 | |||
172 | Functions Removed in 6.x Development cycle |
|
172 | Functions Removed in 6.x Development cycle | |
173 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
173 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
174 |
|
174 | |||
175 | The following functions have been removed in the |
|
175 | The following functions have been removed in the | |
176 | development cycle marked for Milestone 6.0. |
|
176 | development cycle marked for Milestone 6.0. | |
177 |
|
177 | |||
178 | - ``IPython/utils/process.py`` - ``is_cmd_found`` |
|
178 | - ``IPython/utils/process.py`` - ``is_cmd_found`` | |
179 | - ``IPython/utils/process.py`` - ``pycmd2argv`` |
|
179 | - ``IPython/utils/process.py`` - ``pycmd2argv`` | |
180 |
|
180 | |||
181 | - The `--deep-reload` flag and the corresponding options to inject `dreload` or |
|
181 | - The `--deep-reload` flag and the corresponding options to inject `dreload` or | |
182 | `reload` into the interactive namespace have been removed. You have to |
|
182 | `reload` into the interactive namespace have been removed. You have to | |
183 | explicitly import `reload` from `IPython.lib.deepreload` to use it. |
|
183 | explicitly import `reload` from `IPython.lib.deepreload` to use it. | |
184 |
|
184 | |||
185 | - the :magic:`profile` used to print current IPython profile in use, and which |
|
185 | - the :magic:`profile` used to print current IPython profile in use, and which | |
186 | was deprecated in IPython 2.0 does now raise a `DeprecationWarning` error when |
|
186 | was deprecated in IPython 2.0 does now raise a `DeprecationWarning` error when | |
187 | used. It is often confused with the :magic:`prun` and the deprecation remove |
|
187 | used. It is often confused with the :magic:`prun` and the deprecation remove | |
188 | should free up the ``profile`` name in future versions. |
|
188 | should free up the ``profile`` name in future versions. | |
189 |
|
189 | |||
190 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. |
|
190 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. |
General Comments 0
You need to be logged in to leave comments.
Login now