Skip to content

Commit

Permalink
- Fix documentation for compile_restricted_function (fixes #158)
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Jul 12, 2020
1 parent 175abf4 commit a3d5a38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changes
5.1a0 (unreleased)
------------------

- Fix documentation for ``compile_restricted_function``
(`#158 <https://github.com/zopefoundation/RestrictedPython/issues/158>`_)

- Add support for (Python 3.8+) assignment expressions (i.e. the ``:=`` operator)

- Fix ``compile_restricted_function`` with SyntaxErrors that have no text
Expand Down
22 changes: 14 additions & 8 deletions docs/usage/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,22 @@ API overview

Compiles source code into interpretable byte code with ``mode='function'``.

:param p: (required).
:param body: (required).
:param name: (required).
:param filename: (required).
:param globalize: (optional).
:type p:
:type body:
:param p: (required). a string representing the function parameters
:param body: (required). the function body
:param name: (required). the function name
:param filename: (optional). defaults to ``'<string>'``
:param globalize: (optional). list of globals. defaults to ``None``
:param flags: (optional). defaults to ``0``
:param dont_inherit: (optional). defaults to ``False``
:param policy: (optional). defaults to ``RestrictingNodeTransformer``
:type p: str or unicode text
:type body: str or unicode text
:type name: str or unicode text
:type filename: str or unicode text
:type globalize:
:type globalize: None or list
:type flags: int
:type dont_inherit: int
:type policy: RestrictingNodeTransformer class
:return: byte code

The globalize argument, if specified, is a list of variable names to be
Expand Down

0 comments on commit a3d5a38

Please sign in to comment.