##// END OF EJS Templates
microscopic formatting fix
Chris Barker -
Show More
@@ -1,303 +1,303 b''
1 ============
1 ============
2 7.x Series
2 7.x Series
3 ============
3 ============
4
4
5 .. _whatsnew710:
5 .. _whatsnew710:
6
6
7 IPython 7.1.0
7 IPython 7.1.0
8 =============
8 =============
9
9
10
10
11 IPython 7.1.0 is the first minor release after 7.0.0 and mostly bring fixes to
11 IPython 7.1.0 is the first minor release after 7.0.0 and mostly bring fixes to
12 new feature, internal refactor and regressions that happen during the 6.x->7.x
12 new feature, internal refactor and regressions that happen during the 6.x->7.x
13 transition. It also bring **Compatibility with Python 3.7.1**, as were
13 transition. It also bring **Compatibility with Python 3.7.1**, as were
14 unwillingly relying on a bug in CPython.
14 unwillingly relying on a bug in CPython.
15
15
16 New Core Dev:
16 New Core Dev:
17
17
18 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
18 - We welcome Jonathan Slenders to the commiters. Jonathan has done a fantastic
19 work on Prompt toolkit, and we'd like to recognise his impact by giving him
19 work on Prompt toolkit, and we'd like to recognise his impact by giving him
20 commit rights. :ghissue:`11397`
20 commit rights. :ghissue:`11397`
21
21
22 Notable New Features:
22 Notable New Features:
23
23
24 - Restore functionality and documentation of the **sphinx directive**, which is
24 - Restore functionality and documentation of the **sphinx directive**, which is
25 now stricter (fail on error by default), gained configuration options, have a
25 now stricter (fail on error by default), gained configuration options, have a
26 brand new documentation page :ref:`ipython_directive`, which need some cleanup.
26 brand new documentation page :ref:`ipython_directive`, which need some cleanup.
27 It is also now *tested* so we hope to have less regressions.
27 It is also now *tested* so we hope to have less regressions.
28 :ghpull:`11402`
28 :ghpull:`11402`
29
29
30 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
30 - ``IPython.display.Video`` now supports ``width`` and ``height`` arguments,
31 allowing a custom width and height to be set instead of using the video's
31 allowing a custom width and height to be set instead of using the video's
32 width and height. :ghpull:`11353`
32 width and height. :ghpull:`11353`
33
33
34 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
34 - Warn when using ``HTML('<iframe>')`` instead of ``IFrame`` :ghpull:`11350`
35
35
36 - Allow Dynamic switching of editing mode between vi/emacs and show
36 - Allow Dynamic switching of editing mode between vi/emacs and show
37 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
37 normal/input mode in prompt when using vi. :ghpull:`11390`. Use ``%config
38 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
38 TerminalInteractiveShell.editing_mode = 'vi'`` or ``%config
39 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically spwitch
39 TerminalInteractiveShell.editing_mode = 'emacs'`` to dynamically spwitch
40
40
41
41
42 Notable Fixes:
42 Notable Fixes:
43
43
44 - Fix entering of **multi-line block in terminal** IPython, and various crashes
44 - Fix entering of **multi-line block in terminal** IPython, and various crashes
45 in the new input transformation machinery :ghpull:`11354`, :ghpull:`11356`, :ghpull:`11358`, these
45 in the new input transformation machinery :ghpull:`11354`, :ghpull:`11356`, :ghpull:`11358`, these
46 ones also fix a **Compatibility but with Python 3.7.1**.
46 ones also fix a **Compatibility but with Python 3.7.1**.
47
47
48 - Fix moving through generator stack in ipdb :ghpull:`11266`
48 - Fix moving through generator stack in ipdb :ghpull:`11266`
49
49
50 - Magics arguments now support quoting. :ghpull:`11330`
50 - Magics arguments now support quoting. :ghpull:`11330`
51
51
52 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
52 - Re-add ``rprint`` and ``rprinte`` aliases. :ghpull:`11331`
53
53
54 - Remove implicit dependency to ``ipython_genutils`` :ghpull:`11317`
54 - Remove implicit dependency to ``ipython_genutils`` :ghpull:`11317`
55
55
56 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
56 - Make ``nonlocal`` raise ``SyntaxError`` instead of silently failing in async
57 mode. :ghpull:`11382`
57 mode. :ghpull:`11382`
58
58
59
59
60 Notable Internals improvements:
60 Notable Internals improvements:
61
61
62 - Use of ``os.scandir`` (Python 3 only) to speedup some file system operations.
62 - Use of ``os.scandir`` (Python 3 only) to speedup some file system operations.
63 :ghpull:`11365`
63 :ghpull:`11365`
64
64
65 - use ``perf_counter`` instead of ``clock`` for more precise
65 - use ``perf_counter`` instead of ``clock`` for more precise
66 timing result with ``%time`` :ghpull:`11376`
66 timing result with ``%time`` :ghpull:`11376`
67
67
68 Many thanks to all the contributors and in particular to ``bartskowron``, and
68 Many thanks to all the contributors and in particular to ``bartskowron``, and
69 ``tonyfast`` who handled a pretty complicated bugs in the input machinery. We
69 ``tonyfast`` who handled a pretty complicated bugs in the input machinery. We
70 had a number of first time contributors and maybe hacktoberfest participant that
70 had a number of first time contributors and maybe hacktoberfest participant that
71 made significant contributions, and helped us free some time to focus on more
71 made significant contributions, and helped us free some time to focus on more
72 complicated bugs.
72 complicated bugs.
73
73
74 You
74 You
75 can see all the closed issues and Merged PR, new features and fixes `here
75 can see all the closed issues and Merged PR, new features and fixes `here
76 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
76 <https://github.com/ipython/ipython/issues?utf8=%E2%9C%93&q=+is%3Aclosed+milestone%3A7.1+>`_.
77
77
78 .. _whatsnew700:
78 .. _whatsnew700:
79
79
80 IPython 7.0.0
80 IPython 7.0.0
81 =============
81 =============
82
82
83 Released Thursday September 27th, 2018
83 Released Thursday September 27th, 2018
84
84
85 IPython 7 include major features improvement as you can read in the following
85 IPython 7 include major features improvement as you can read in the following
86 changelog. This is also the second major version of IPython to support only
86 changelog. This is also the second major version of IPython to support only
87 Python 3 – starting at Python 3.4. Python 2 is still community supported
87 Python 3 – starting at Python 3.4. Python 2 is still community supported
88 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
88 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
89 is on Jan 1st 2020.
89 is on Jan 1st 2020.
90
90
91 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
91 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
92 backported more than `70 Pull-Requests
92 backported more than `70 Pull-Requests
93 <https://github.com/ipython/ipython/pulls?page=3&q=is%3Apr+sort%3Aupdated-desc+author%3Aapp%2Fmeeseeksdev++5.x&utf8=%E2%9C%93>`_, but there are still many PRs that required manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
93 <https://github.com/ipython/ipython/pulls?page=3&q=is%3Apr+sort%3Aupdated-desc+author%3Aapp%2Fmeeseeksdev++5.x&utf8=%E2%9C%93>`_, but there are still many PRs that required manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
94
94
95 IPython 6.x branch will likely not see any further release unless critical
95 IPython 6.x branch will likely not see any further release unless critical
96 bugs are found.
96 bugs are found.
97
97
98 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
98 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
99
99
100 .. code::
100 .. code::
101
101
102 pip install ipython --upgrade
102 pip install ipython --upgrade
103
103
104 .. only:: ipydev
104 .. only:: ipydev
105
105
106 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
106 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
107 version, use pip ``--pre`` flag.
107 version, use pip ``--pre`` flag.
108
108
109 .. code::
109 .. code::
110
110
111 pip install ipython --upgrade --pre
111 pip install ipython --upgrade --pre
112
112
113
113
114 Or if you have conda installed:
114 Or if you have conda installed:
115
115
116 .. code::
116 .. code::
117
117
118 conda install ipython
118 conda install ipython
119
119
120
120
121
121
122 Prompt Toolkit 2.0
122 Prompt Toolkit 2.0
123 ------------------
123 ------------------
124
124
125 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
125 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
126 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
126 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
127
127
128 Autowait: Asynchronous REPL
128 Autowait: Asynchronous REPL
129 ---------------------------
129 ---------------------------
130
130
131 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
131 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
132 code at top level, you should not need to access an event loop or runner
132 code at top level, you should not need to access an event loop or runner
133 yourself. To know more read the :ref:`autoawait` section of our docs, see
133 yourself. To know more read the :ref:`autoawait` section of our docs, see
134 :ghpull:`11265` or try the following code::
134 :ghpull:`11265` or try the following code::
135
135
136 Python 3.6.0
136 Python 3.6.0
137 Type 'copyright', 'credits' or 'license' for more information
137 Type 'copyright', 'credits' or 'license' for more information
138 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
138 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
139
139
140 In [1]: import aiohttp
140 In [1]: import aiohttp
141 ...: result = aiohttp.get('https://api.github.com')
141 ...: result = aiohttp.get('https://api.github.com')
142
142
143 In [2]: response = await result
143 In [2]: response = await result
144 <pause for a few 100s ms>
144 <pause for a few 100s ms>
145
145
146 In [3]: await response.json()
146 In [3]: await response.json()
147 Out[3]:
147 Out[3]:
148 {'authorizations_url': 'https://api.github.com/authorizations',
148 {'authorizations_url': 'https://api.github.com/authorizations',
149 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
149 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
150 ...
150 ...
151 }
151 }
152
152
153 .. note::
153 .. note::
154
154
155 Async integration is experimental code, behavior may change or be removed
155 Async integration is experimental code, behavior may change or be removed
156 between Python and IPython versions without warnings.
156 between Python and IPython versions without warnings.
157
157
158 Integration is by default with `asyncio`, but other libraries can be configured,
158 Integration is by default with `asyncio`, but other libraries can be configured,
159 like ``curio`` or ``trio``, to improve concurrency in the REPL::
159 like ``curio`` or ``trio``, to improve concurrency in the REPL::
160
160
161 In [1]: %autoawait trio
161 In [1]: %autoawait trio
162
162
163 In [2]: import trio
163 In [2]: import trio
164
164
165 In [3]: async def child(i):
165 In [3]: async def child(i):
166 ...: print(" child %s goes to sleep"%i)
166 ...: print(" child %s goes to sleep"%i)
167 ...: await trio.sleep(2)
167 ...: await trio.sleep(2)
168 ...: print(" child %s wakes up"%i)
168 ...: print(" child %s wakes up"%i)
169
169
170 In [4]: print('parent start')
170 In [4]: print('parent start')
171 ...: async with trio.open_nursery() as n:
171 ...: async with trio.open_nursery() as n:
172 ...: for i in range(3):
172 ...: for i in range(3):
173 ...: n.spawn(child, i)
173 ...: n.spawn(child, i)
174 ...: print('parent end')
174 ...: print('parent end')
175 parent start
175 parent start
176 child 2 goes to sleep
176 child 2 goes to sleep
177 child 0 goes to sleep
177 child 0 goes to sleep
178 child 1 goes to sleep
178 child 1 goes to sleep
179 <about 2 seconds pause>
179 <about 2 seconds pause>
180 child 2 wakes up
180 child 2 wakes up
181 child 1 wakes up
181 child 1 wakes up
182 child 0 wakes up
182 child 0 wakes up
183 parent end
183 parent end
184
184
185 See :ref:`autoawait` for more information.
185 See :ref:`autoawait` for more information.
186
186
187
187
188 Asynchronous code in a Notebook interface or any other frontend using the
188 Asynchronous code in a Notebook interface or any other frontend using the
189 Jupyter Protocol will need further updates of the IPykernel package.
189 Jupyter Protocol will need further updates of the IPykernel package.
190
190
191 Non-Asynchronous code
191 Non-Asynchronous code
192 ~~~~~~~~~~~~~~~~~~~~~
192 ~~~~~~~~~~~~~~~~~~~~~
193
193
194 As the internal API of IPython is now asynchronous, IPython needs to run under
194 As the internal API of IPython is now asynchronous, IPython needs to run under
195 an event loop. In order to allow many workflows, (like using the :magic:`%run`
195 an event loop. In order to allow many workflows, (like using the :magic:`%run`
196 magic, or copy_pasting code that explicitly starts/stop event loop), when
196 magic, or copy_pasting code that explicitly starts/stop event loop), when
197 top-level code is detected as not being asynchronous, IPython code is advanced
197 top-level code is detected as not being asynchronous, IPython code is advanced
198 via a pseudo-synchronous runner, and may not advance pending tasks.
198 via a pseudo-synchronous runner, and may not advance pending tasks.
199
199
200 Change to Nested Embed
200 Change to Nested Embed
201 ~~~~~~~~~~~~~~~~~~~~~~
201 ~~~~~~~~~~~~~~~~~~~~~~
202
202
203 The introduction of the ability to run async code had some effect on the
203 The introduction of the ability to run async code had some effect on the
204 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
204 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
205 code unless a event loop is specified.
205 code unless a event loop is specified.
206
206
207 Effects on Magics
207 Effects on Magics
208 ~~~~~~~~~~~~~~~~~
208 ~~~~~~~~~~~~~~~~~
209
209
210 Some magics will not work with Async, and will need updates. Contribution
210 Some magics will not work with Async, and will need updates. Contribution
211 welcome.
211 welcome.
212
212
213 Expected Future changes
213 Expected Future changes
214 ~~~~~~~~~~~~~~~~~~~~~~~
214 ~~~~~~~~~~~~~~~~~~~~~~~
215
215
216 We expect more internal but public IPython function to become ``async``, and
216 We expect more internal but public IPython function to become ``async``, and
217 will likely end up having a persisting event loop while IPython is running.
217 will likely end up having a persisting event loop while IPython is running.
218
218
219 Thanks
219 Thanks
220 ~~~~~~
220 ~~~~~~
221
221
222 This took more than a year in the making, and the code was rebased a number of
222 This took more than a year in the making, and the code was rebased a number of
223 time leading to commit authorship that may have been lost in the final
223 time leading to commit authorship that may have been lost in the final
224 Pull-Request. Huge thanks to many people for contribution, discussion, code,
224 Pull-Request. Huge thanks to many people for contribution, discussion, code,
225 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
225 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
226 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
226 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
227
227
228
228
229 Autoreload Improvement
229 Autoreload Improvement
230 ----------------------
230 ----------------------
231
231
232 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
232 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
233 classes. Earlier, only methods existing as of the initial import were being
233 classes. Earlier, only methods existing as of the initial import were being
234 tracked and updated.
234 tracked and updated.
235
235
236 This new feature helps dual environment development - Jupyter+IDE - where the
236 This new feature helps dual environment development - Jupyter+IDE - where the
237 code gradually moves from notebook cells to package files, as it gets
237 code gradually moves from notebook cells to package files, as it gets
238 structured.
238 structured.
239
239
240 **Example**: An instance of the class ``MyClass`` will be able to access the
240 **Example**: An instance of the class ``MyClass`` will be able to access the
241 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
241 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
242 disk.
242 disk.
243
243
244
244
245 ..code::
245 .. code::
246
246
247 # notebook
247 # notebook
248
248
249 from mymodule import MyClass
249 from mymodule import MyClass
250 first = MyClass(5)
250 first = MyClass(5)
251
251
252 .. code::
252 .. code::
253
253
254 # mymodule/file1.py
254 # mymodule/file1.py
255
255
256 class MyClass:
256 class MyClass:
257
257
258 def __init__(self, a=10):
258 def __init__(self, a=10):
259 self.a = a
259 self.a = a
260
260
261 def square(self):
261 def square(self):
262 print('compute square')
262 print('compute square')
263 return self.a*self.a
263 return self.a*self.a
264
264
265 # def cube(self):
265 # def cube(self):
266 # print('compute cube')
266 # print('compute cube')
267 # return self.a*self.a*self.a
267 # return self.a*self.a*self.a
268
268
269
269
270
270
271
271
272 Misc
272 Misc
273 ----
273 ----
274
274
275 The autoindent feature that was deprecated in 5.x was re-enabled and
275 The autoindent feature that was deprecated in 5.x was re-enabled and
276 un-deprecated in :ghpull:`11257`
276 un-deprecated in :ghpull:`11257`
277
277
278 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
278 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
279 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
279 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
280
280
281
281
282 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
282 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
283 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
283 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
284 the given code is non-zero (thus halting execution of further cells in a
284 the given code is non-zero (thus halting execution of further cells in a
285 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
285 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
286
286
287
287
288 Deprecations
288 Deprecations
289 ------------
289 ------------
290
290
291 A couple of unused function and methods have been deprecated and will be removed
291 A couple of unused function and methods have been deprecated and will be removed
292 in future versions:
292 in future versions:
293
293
294 - ``IPython.utils.io.raw_print_err``
294 - ``IPython.utils.io.raw_print_err``
295 - ``IPython.utils.io.raw_print``
295 - ``IPython.utils.io.raw_print``
296
296
297
297
298 Backwards incompatible changes
298 Backwards incompatible changes
299 ------------------------------
299 ------------------------------
300
300
301 * The API for transforming input before it is parsed as Python code has been
301 * The API for transforming input before it is parsed as Python code has been
302 completely redesigned, and any custom input transformations will need to be
302 completely redesigned, and any custom input transformations will need to be
303 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
303 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
General Comments 0
You need to be logged in to leave comments. Login now