@@ -238,7 +238,7 @@ def imagemath_convert(self: _Operand, mode: str) -> _Operand:
238
238
239
239
def lambda_eval (
240
240
expression : Callable [[dict [str , Any ]], Any ],
241
- _dict : dict [str , Any ] = {},
241
+ options : dict [str , Any ] = {},
242
242
** kw : Any ,
243
243
) -> Any :
244
244
"""
@@ -258,7 +258,7 @@ def lambda_eval(
258
258
"""
259
259
260
260
args : dict [str , Any ] = ops .copy ()
261
- args .update (_dict )
261
+ args .update (options )
262
262
args .update (kw )
263
263
for k , v in args .items ():
264
264
if hasattr (v , "im" ):
@@ -273,7 +273,7 @@ def lambda_eval(
273
273
274
274
def unsafe_eval (
275
275
expression : str ,
276
- _dict : dict [str , Any ] = {},
276
+ options : dict [str , Any ] = {},
277
277
** kw : Any ,
278
278
) -> Any :
279
279
"""
@@ -297,12 +297,12 @@ def unsafe_eval(
297
297
298
298
# build execution namespace
299
299
args : dict [str , Any ] = ops .copy ()
300
- for k in list (_dict .keys ()) + list (kw .keys ()):
300
+ for k in list (options .keys ()) + list (kw .keys ()):
301
301
if "__" in k or hasattr (builtins , k ):
302
302
msg = f"'{ k } ' not allowed"
303
303
raise ValueError (msg )
304
304
305
- args .update (_dict )
305
+ args .update (options )
306
306
args .update (kw )
307
307
for k , v in args .items ():
308
308
if hasattr (v , "im" ):
@@ -339,9 +339,9 @@ def eval(
339
339
Deprecated. Use lambda_eval() or unsafe_eval() instead.
340
340
341
341
:param expression: A string containing a Python-style expression.
342
- :param options : Values to add to the evaluation context. You
343
- can either use a dictionary, or one or more keyword
344
- arguments.
342
+ :param _dict : Values to add to the evaluation context. You
343
+ can either use a dictionary, or one or more keyword
344
+ arguments.
345
345
:return: The evaluated expression. This is usually an image object, but can
346
346
also be an integer, a floating point value, or a pixel tuple,
347
347
depending on the expression.
0 commit comments