-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error code "explicit-override" for strict @OverRide mode (PEP 698) (
#15512) Add the strict mode for [PEP 698](https://peps.python.org/pep-0698/#strict-enforcement-per-project). Closes: #14072
Showing
7 changed files
with
291 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
TypeVar = 0 | ||
Generic = 0 | ||
Any = 0 | ||
overload = 0 | ||
Type = 0 | ||
Literal = 0 | ||
Optional = 0 | ||
Self = 0 | ||
Tuple = 0 | ||
ClassVar = 0 | ||
Callable = 0 | ||
|
||
T = TypeVar('T') | ||
T_co = TypeVar('T_co', covariant=True) | ||
KT = TypeVar('KT') | ||
|
||
class Iterable(Generic[T_co]): pass | ||
class Iterator(Iterable[T_co]): pass | ||
class Sequence(Iterable[T_co]): pass | ||
class Mapping(Iterable[KT], Generic[KT, T_co]): | ||
def keys(self) -> Iterable[T]: pass # Approximate return type | ||
def __getitem__(self, key: T) -> T_co: pass | ||
|
||
|
||
def override(__arg: T) -> T: ... |