Skip to content

Commit 4809ce8

Browse files
committed
Wrap functools.partial in staticmethod() to add compatibility with
Python 3.14 Fixes: #1480
1 parent 24f19a3 commit 4809ce8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_trees.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def ab_method(self, a, b):
254254
ab_partialmethod = partialmethod(ab_for_partialmethod, 1)
255255
set_union = set(["a"]).union
256256
static_add = staticmethod(add)
257-
partial_reduce_mul = partial(reduce, mul)
257+
partial_reduce_mul = staticmethod(partial(reduce, mul))
258258

259259
custom_callable = CustomCallable()
260260

@@ -355,8 +355,8 @@ def test(prefix, s, postfix):
355355

356356
@v_args(inline=True)
357357
class T(Transformer):
358-
a = functools.partial(test, "@", postfix="!")
359-
b = functools.partial(lambda s: s + "!")
358+
a = staticmethod(functools.partial(test, "@", postfix="!"))
359+
b = staticmethod(functools.partial(lambda s: s + "!"))
360360

361361
res = T().transform(tree)
362362
assert res.children == ["@TEST1!", "test2!"]

0 commit comments

Comments
 (0)