Skip to content

Commit a3d5a38

Browse files
committed
- Fix documentation for compile_restricted_function (fixes #158)
1 parent 175abf4 commit a3d5a38

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Changes
44
5.1a0 (unreleased)
55
------------------
66

7+
- Fix documentation for ``compile_restricted_function``
8+
(`#158 <https://github.com/zopefoundation/RestrictedPython/issues/158>`_)
9+
710
- Add support for (Python 3.8+) assignment expressions (i.e. the ``:=`` operator)
811

912
- Fix ``compile_restricted_function`` with SyntaxErrors that have no text

docs/usage/api.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,22 @@ API overview
5555

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

58-
:param p: (required).
59-
:param body: (required).
60-
:param name: (required).
61-
:param filename: (required).
62-
:param globalize: (optional).
63-
:type p:
64-
:type body:
58+
:param p: (required). a string representing the function parameters
59+
:param body: (required). the function body
60+
:param name: (required). the function name
61+
:param filename: (optional). defaults to ``'<string>'``
62+
:param globalize: (optional). list of globals. defaults to ``None``
63+
:param flags: (optional). defaults to ``0``
64+
:param dont_inherit: (optional). defaults to ``False``
65+
:param policy: (optional). defaults to ``RestrictingNodeTransformer``
66+
:type p: str or unicode text
67+
:type body: str or unicode text
6568
:type name: str or unicode text
6669
:type filename: str or unicode text
67-
:type globalize:
70+
:type globalize: None or list
71+
:type flags: int
72+
:type dont_inherit: int
73+
:type policy: RestrictingNodeTransformer class
6874
:return: byte code
6975

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

0 commit comments

Comments
 (0)