Skip to content

Commit 7248cde

Browse files
committed
Documented keyword arguments
1 parent 10faa5d commit 7248cde

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

docs/reference/ImageMath.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@ Example: Using the :py:mod:`~PIL.ImageMath` module
3131
b=im2
3232
)
3333

34-
.. py:function:: lambda_eval(expression, options)
34+
.. py:function:: lambda_eval(expression, options, **kw)
3535
3636
Returns the result of an image function.
3737

3838
:param expression: A function that receives a dictionary.
39-
:param options: Values to add to the function's dictionary, mapping image
40-
names to Image instances. Deprecated.
39+
:param options: Values to add to the function's dictionary. Note that the names
40+
must be valid Python identifiers. Deprecated.
4141
You can instead use one or more keyword arguments, as
42-
shown in the above example. Note that the names must be
43-
valid Python identifiers.
42+
shown in the above example.
43+
:param \**kw: Values to add to the function's dictionary, mapping image names to
44+
Image instances.
4445
:return: An image, an integer value, a floating point value,
4546
or a pixel tuple, depending on the expression.
4647

47-
.. py:function:: unsafe_eval(expression, options)
48+
.. py:function:: unsafe_eval(expression, options, **kw)
4849
4950
Evaluates an image expression.
5051

@@ -61,11 +62,12 @@ Example: Using the :py:mod:`~PIL.ImageMath` module
6162
:param expression: A string which uses the standard Python expression
6263
syntax. In addition to the standard operators, you can
6364
also use the functions described below.
64-
:param options: Values to add to the function's dictionary, mapping image
65-
names to Image instances. Deprecated.
65+
:param options: Values to add to the evaluation context. Note that the names must
66+
be valid Python identifiers. Deprecated.
6667
You can instead use one or more keyword arguments, as
67-
shown in the above example. Note that the names must be
68-
valid Python identifiers.
68+
shown in the above example.
69+
:param \**kw: Values to add to the evaluation context, mapping image names to Image
70+
instances.
6971
:return: An image, an integer value, a floating point value,
7072
or a pixel tuple, depending on the expression.
7173

src/PIL/ImageMath.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def lambda_eval(
251251
:param expression: A function that receives a dictionary.
252252
:param options: Values to add to the function's dictionary. Deprecated.
253253
You can instead use one or more keyword arguments.
254+
:param **kw: Values to add to the function's dictionary.
254255
:return: The expression result. This is usually an image object, but can
255256
also be an integer, a floating point value, or a pixel tuple,
256257
depending on the expression.
@@ -295,6 +296,7 @@ def unsafe_eval(
295296
:param expression: A string containing a Python-style expression.
296297
:param options: Values to add to the evaluation context. Deprecated.
297298
You can instead use one or more keyword arguments.
299+
:param **kw: Values to add to the evaluation context.
298300
:return: The evaluated expression. This is usually an image object, but can
299301
also be an integer, a floating point value, or a pixel tuple,
300302
depending on the expression.

0 commit comments

Comments
 (0)