Skip to content

Commit

Permalink
Use a positional-only argument named method
Browse files Browse the repository at this point in the history
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
stroxler committed Feb 27, 2023
1 parent afb74de commit 090d9d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@ def decorator(cls_or_fn):



def override(__arg: F) -> F:
def override(method: F, /) -> F:
"""Indicate that a method is intended to override a method in a base class.
Usage:
Expand All @@ -3482,10 +3482,10 @@ def method(self) -> None:
"""
try:
__arg.__override__ = True
method.__override__ = True
except (AttributeError, TypeError):
# Skip the attribute silently if it is not writable.
# AttributeError happens if the object has __slots__ or a
# read-only property, TypeError if it's a builtin class.
pass
return __arg
return method

0 comments on commit 090d9d2

Please sign in to comment.