Skip to content

Commit 95feb57

Browse files
authored
Merge pull request #1483 from hrnciar/compatibility-with-python3.14
Wrap functools.partial in staticmethod() to add compatibility with Python 3.14
2 parents 5499f10 + 4809ce8 commit 95feb57

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
@@ -264,7 +264,7 @@ def ab_method(self, a, b):
264264
ab_partialmethod = partialmethod(ab_for_partialmethod, 1)
265265
set_union = set(["a"]).union
266266
static_add = staticmethod(add)
267-
partial_reduce_mul = partial(reduce, mul)
267+
partial_reduce_mul = staticmethod(partial(reduce, mul))
268268

269269
custom_callable = CustomCallable()
270270

@@ -365,8 +365,8 @@ def test(prefix, s, postfix):
365365

366366
@v_args(inline=True)
367367
class T(Transformer):
368-
a = functools.partial(test, "@", postfix="!")
369-
b = functools.partial(lambda s: s + "!")
368+
a = staticmethod(functools.partial(test, "@", postfix="!"))
369+
b = staticmethod(functools.partial(lambda s: s + "!"))
370370

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy