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