Skip to content

Commit d65f194

Browse files
committed
small changes
1 parent ec64137 commit d65f194

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/functools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ def __setstate__(self, state):
433433
_NULL = object()
434434
_UNKNOWN_DESCRIPTOR = object()
435435
_STD_METHOD_TYPES = (staticmethod, classmethod, FunctionType, partial)
436+
_ONE_PLACEHOLDER_TUPLE = (Placeholder,)
436437

437438
# Descriptor version
438439
class partialmethod:
@@ -482,20 +483,19 @@ def _make_method(self):
482483
args = self.args
483484
func = self.func
484485

485-
# 4 cases
486486
if isinstance(func, staticmethod):
487487
deco = staticmethod
488488
method = partial(func.__wrapped__, *args, **self.keywords)
489489
elif isinstance(func, classmethod):
490490
deco = classmethod
491-
ph_args = (Placeholder,) if args else ()
491+
ph_args = _ONE_PLACEHOLDER_TUPLE if args else ()
492492
method = partial(func.__wrapped__, *ph_args, *args, **self.keywords)
493493
else:
494494
# instance method. 2 cases:
495495
# a) FunctionType | partial
496496
# b) callable object without __get__
497497
deco = None
498-
ph_args = (Placeholder,) if args else ()
498+
ph_args = _ONE_PLACEHOLDER_TUPLE if args else ()
499499
method = partial(func, *ph_args, *args, **self.keywords)
500500

501501
method.__partialmethod__ = self

0 commit comments

Comments
 (0)