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