Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c78df7

Browse files
committed
Reformat some of the IPython docstrings.
1 parent ba11b22 commit 2c78df7

3 files changed

Lines changed: 28 additions & 28 deletions

File tree

IPython/core/async_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def _pseudo_sync_runner(coro):
6262
See discussion in https://github.com/python-trio/trio/issues/608,
6363
6464
Credit to Nathaniel Smith
65-
6665
"""
6766
try:
6867
coro.send(None)

IPython/core/interactiveshell.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ def _ast_asyncify(cell:str, wrapper_name:str) -> ast.Module:
173173
"""
174174
Parse a cell with top-level await and modify the AST to be able to run it later.
175175
176-
Parameter
177-
---------
176+
Parameters
177+
----------
178178
179179
cell: str
180180
The code cell to asyncronify
@@ -183,28 +183,29 @@ def _ast_asyncify(cell:str, wrapper_name:str) -> ast.Module:
183183
advised to **not** use a python identifier in order to not pollute the
184184
global namespace in which the function will be ran.
185185
186-
Return
187-
------
188-
189-
A module object AST containing **one** function named `wrapper_name`.
190-
191-
The given code is wrapped in a async-def function, parsed into an AST, and
192-
the resulting function definition AST is modified to return the last
193-
expression.
194-
195-
The last expression or await node is moved into a return statement at the
196-
end of the function, and removed from its original location. If the last
197-
node is not Expr or Await nothing is done.
198-
199-
The function `__code__` will need to be later modified (by
200-
``removed_co_newlocals``) in a subsequent step to not create new `locals()`
201-
meaning that the local and global scope are the same, ie as if the body of
202-
the function was at module level.
203-
204-
Lastly a call to `locals()` is made just before the last expression of the
205-
function, or just after the last assignment or statement to make sure the
206-
global dict is updated as python function work with a local fast cache which
207-
is updated only on `local()` calls.
186+
Returns
187+
-------
188+
189+
ModuleType:
190+
A module object AST containing **one** function named `wrapper_name`.
191+
192+
The given code is wrapped in a async-def function, parsed into an AST, and
193+
the resulting function definition AST is modified to return the last
194+
expression.
195+
196+
The last expression or await node is moved into a return statement at the
197+
end of the function, and removed from its original location. If the last
198+
node is not Expr or Await nothing is done.
199+
200+
The function `__code__` will need to be later modified (by
201+
``removed_co_newlocals``) in a subsequent step to not create new `locals()`
202+
meaning that the local and global scope are the same, ie as if the body of
203+
the function was at module level.
204+
205+
Lastly a call to `locals()` is made just before the last expression of the
206+
function, or just after the last assignment or statement to make sure the
207+
global dict is updated as python function work with a local fast cache which
208+
is updated only on `local()` calls.
208209
"""
209210

210211
from ast import Expr, Await, Return

setupbase.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def check_package_data(package_data):
141141

142142
def check_package_data_first(command):
143143
"""decorator for checking package_data before running a given command
144-
144+
145145
Probably only needs to wrap build_py
146146
"""
147147
class DecoratedCommand(command):
@@ -351,9 +351,9 @@ def finalize_options(self):
351351

352352
def git_prebuild(pkg_dir, build_cmd=build_py):
353353
"""Return extended build or sdist command class for recording commit
354-
354+
355355
records git commit in IPython.utils._sysinfo.commit
356-
356+
357357
for use in IPython.utils.sysinfo.sys_info() calls after installation.
358358
"""
359359

0 commit comments

Comments
 (0)