mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-06 21:40:09 +03:00
Rewrite as dict comprehension
This commit is contained in:
parent
69ada9994a
commit
96eb24b768
|
@ -227,11 +227,7 @@ def imagemath_convert(self: _Operand, mode: str) -> _Operand:
|
|||
|
||||
@cache
|
||||
def _get_ops() -> dict[str, Any]:
|
||||
ops = {}
|
||||
for k, v in list(globals().items()):
|
||||
if k[:10] == "imagemath_":
|
||||
ops[k[10:]] = v
|
||||
return ops
|
||||
return {k[10:]: v for k, v in globals().items() if k[:10] == "imagemath_"}
|
||||
|
||||
|
||||
def eval(expression: str, _dict: dict[str, Any] = {}, **kw: Any) -> Any:
|
||||
|
|
Loading…
Reference in New Issue
Block a user