Skip to content

Commit 81c3e8a

Browse files
committed
trailing Placeholder error at definition
1 parent 0b38bb8 commit 81c3e8a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/functools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,7 @@ class partialmethod:
450450
callables as instance methods.
451451
"""
452452

453-
__slots__ = ("func", "args", "keywords", "wrapper",
454-
"__dict__", "__weakref__")
453+
__slots__ = ("func", "args", "keywords", "__dict__", "__weakref__")
455454

456455
__repr__ = _partial_repr
457456

@@ -464,6 +463,9 @@ def __init__(self, func, /, *args, **keywords):
464463
args = temp.args
465464
keywords = temp.keywords
466465

466+
if args and args[-1] is Placeholder:
467+
raise TypeError("trailing Placeholders are not allowed")
468+
467469
self.func = func
468470
self.args = args
469471
self.keywords = keywords

0 commit comments

Comments
 (0)