Skip to content

Commit

Permalink
Reformat some of the IPython docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Jul 11, 2020
1 parent ba11b22 commit 2c78df7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
1 change: 0 additions & 1 deletion IPython/core/async_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def _pseudo_sync_runner(coro):
See discussion in https://github.com/python-trio/trio/issues/608,
Credit to Nathaniel Smith
"""
try:
coro.send(None)
Expand Down
49 changes: 25 additions & 24 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def _ast_asyncify(cell:str, wrapper_name:str) -> ast.Module:
"""
Parse a cell with top-level await and modify the AST to be able to run it later.
Parameter
---------
Parameters
----------
cell: str
The code cell to asyncronify
Expand All @@ -183,28 +183,29 @@ def _ast_asyncify(cell:str, wrapper_name:str) -> ast.Module:
advised to **not** use a python identifier in order to not pollute the
global namespace in which the function will be ran.
Return
------
A module object AST containing **one** function named `wrapper_name`.
The given code is wrapped in a async-def function, parsed into an AST, and
the resulting function definition AST is modified to return the last
expression.
The last expression or await node is moved into a return statement at the
end of the function, and removed from its original location. If the last
node is not Expr or Await nothing is done.
The function `__code__` will need to be later modified (by
``removed_co_newlocals``) in a subsequent step to not create new `locals()`
meaning that the local and global scope are the same, ie as if the body of
the function was at module level.
Lastly a call to `locals()` is made just before the last expression of the
function, or just after the last assignment or statement to make sure the
global dict is updated as python function work with a local fast cache which
is updated only on `local()` calls.
Returns
-------
ModuleType:
A module object AST containing **one** function named `wrapper_name`.
The given code is wrapped in a async-def function, parsed into an AST, and
the resulting function definition AST is modified to return the last
expression.
The last expression or await node is moved into a return statement at the
end of the function, and removed from its original location. If the last
node is not Expr or Await nothing is done.
The function `__code__` will need to be later modified (by
``removed_co_newlocals``) in a subsequent step to not create new `locals()`
meaning that the local and global scope are the same, ie as if the body of
the function was at module level.
Lastly a call to `locals()` is made just before the last expression of the
function, or just after the last assignment or statement to make sure the
global dict is updated as python function work with a local fast cache which
is updated only on `local()` calls.
"""

from ast import Expr, Await, Return
Expand Down
6 changes: 3 additions & 3 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def check_package_data(package_data):

def check_package_data_first(command):
"""decorator for checking package_data before running a given command
Probably only needs to wrap build_py
"""
class DecoratedCommand(command):
Expand Down Expand Up @@ -351,9 +351,9 @@ def finalize_options(self):

def git_prebuild(pkg_dir, build_cmd=build_py):
"""Return extended build or sdist command class for recording commit
records git commit in IPython.utils._sysinfo.commit
for use in IPython.utils.sysinfo.sys_info() calls after installation.
"""

Expand Down

0 comments on commit 2c78df7

Please sign in to comment.