Skip to content

Commit be92886

Browse files
committed
Cosmetic fixes in docstrings
1 parent b7c50ff commit be92886

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

numexpr/necompiler.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ def validate(ex: str,
884884
except KeyError:
885885
compiled_ex = _numexpr_cache[numexpr_key] = NumExpr(ex, signature, sanitize=sanitize, **context)
886886
kwargs = {'out': out, 'order': order, 'casting': casting,
887-
'ex_uses_vml': ex_uses_vml}
887+
'ex_uses_vml': ex_uses_vml}
888888
_numexpr_last.set(ex=compiled_ex, argnames=names, kwargs=kwargs)
889889
except Exception as e:
890890
return e
@@ -943,9 +943,9 @@ def evaluate(ex: str,
943943
* 'unsafe' means any data conversions may be done.
944944
945945
sanitize: bool
946-
Both `validate` and by extension `evaluate` call `eval(ex)`, which is
947-
potentially dangerous on unsanitized inputs. As such, NumExpr by default
948-
performs simple sanitization, banning the character ':;[', the
946+
`validate` (and by extension `evaluate`) call `eval(ex)`, which is
947+
potentially dangerous on non-sanitized inputs. As such, NumExpr by default
948+
performs simple sanitization, banning the characters ':;[', the
949949
dunder '__[\w+]__', and attribute access to all but '.real' and '.imag'.
950950
951951
Using `None` defaults to `True` unless the environment variable
@@ -956,15 +956,9 @@ def evaluate(ex: str,
956956
The calling frame depth. Unless you are a NumExpr developer you should
957957
not set this value.
958958
959-
Note
960-
----
961-
Both `validate` and by extension `evaluate` call `eval(ex)`, which is
962-
potentially dangerous on unsanitized inputs. As such, NumExpr does some
963-
sanitization, banning the character ':;[', the dunder '__', and attribute
964-
access to all but '.r' for real and '.i' for imag access to complex numbers.
965959
"""
966960
# We could avoid code duplication if we called validate and then re_evaluate
967-
# here, but they we have difficulties with the `sys.getframe(2)` call in
961+
# here, but we have difficulties with the `sys.getframe(2)` call in
968962
# `getArguments`
969963
e = validate(ex, local_dict=local_dict, global_dict=global_dict,
970964
out=out, order=order, casting=casting,

0 commit comments

Comments
 (0)