forked from astral-sh/ruff
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to Python 3.11 and lower implementation
- Loading branch information
Showing
4 changed files
with
42 additions
and
84 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
33 changes: 33 additions & 0 deletions
33
...uff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI019_PYI019.pyi.snap
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,33 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_pyi/mod.rs | ||
--- | ||
PYI019.pyi:7:62: PYI019 Methods like __new__ should return `typing.Self` instead of a custom TypeVar | ||
| | ||
6 | class BadClass: | ||
7 | def __new__(cls: type[_S], *args: str, **kwargs: int) -> _S: ... # PYI019 | ||
| ^^ PYI019 | ||
8 | def bad_instance_method(self: _S, arg: bytes) -> _S: ... # PYI019 | ||
9 | @classmethod | ||
| | ||
|
||
PYI019.pyi:8:54: PYI019 Methods like bad_instance_method should return `typing.Self` instead of a custom TypeVar | ||
| | ||
6 | class BadClass: | ||
7 | def __new__(cls: type[_S], *args: str, **kwargs: int) -> _S: ... # PYI019 | ||
8 | def bad_instance_method(self: _S, arg: bytes) -> _S: ... # PYI019 | ||
| ^^ PYI019 | ||
9 | @classmethod | ||
10 | def bad_class_method(cls: type[_S], arg: int) -> _S: ... # PYI019 | ||
| | ||
|
||
PYI019.pyi:10:54: PYI019 Methods like bad_class_method should return `typing.Self` instead of a custom TypeVar | ||
| | ||
8 | def bad_instance_method(self: _S, arg: bytes) -> _S: ... # PYI019 | ||
9 | @classmethod | ||
10 | def bad_class_method(cls: type[_S], arg: int) -> _S: ... # PYI019 | ||
| ^^ PYI019 | ||
11 | | ||
12 | class GoodClass: | ||
| | ||
|
||
|