Skip to content

Commit 090d9d2

Browse files
committed
Use a positional-only argument named method
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent afb74de commit 090d9d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/typing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,7 @@ def decorator(cls_or_fn):
34553455

34563456

34573457

3458-
def override(__arg: F) -> F:
3458+
def override(method: F, /) -> F:
34593459
"""Indicate that a method is intended to override a method in a base class.
34603460
34613461
Usage:
@@ -3482,10 +3482,10 @@ def method(self) -> None:
34823482
34833483
"""
34843484
try:
3485-
__arg.__override__ = True
3485+
method.__override__ = True
34863486
except (AttributeError, TypeError):
34873487
# Skip the attribute silently if it is not writable.
34883488
# AttributeError happens if the object has __slots__ or a
34893489
# read-only property, TypeError if it's a builtin class.
34903490
pass
3491-
return __arg
3491+
return method

0 commit comments

Comments
 (0)