mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-07 22:04:46 +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
|
@cache
|
||||||
def _get_ops() -> dict[str, Any]:
|
def _get_ops() -> dict[str, Any]:
|
||||||
ops = {}
|
return {k[10:]: v for k, v in globals().items() if k[:10] == "imagemath_"}
|
||||||
for k, v in list(globals().items()):
|
|
||||||
if k[:10] == "imagemath_":
|
|
||||||
ops[k[10:]] = v
|
|
||||||
return ops
|
|
||||||
|
|
||||||
|
|
||||||
def eval(expression: str, _dict: dict[str, Any] = {}, **kw: Any) -> Any:
|
def eval(expression: str, _dict: dict[str, Any] = {}, **kw: Any) -> Any:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user