-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for bare
Incomplete
annotations (#475)
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from _typeshed import Incomplete | ||
from typing_extensions import TypeAlias | ||
|
||
IncompleteAlias: TypeAlias = Incomplete # ok | ||
|
||
att: Incomplete # ok | ||
|
||
def ok(x: Incomplete | None) -> list[Incomplete]: ... | ||
def aliased(x: IncompleteAlias) -> IncompleteAlias: ... # ok | ||
def err1( | ||
x: Incomplete, # Y065 Leave parameter "x" unannotated rather than using "Incomplete" | ||
) -> None: ... | ||
def err2() -> ( | ||
Incomplete # Y065 Leave return type unannotated rather than using "Incomplete" | ||
): ... | ||
|
||
class Foo: | ||
att: Incomplete | ||
def ok(self, x: Incomplete | None) -> list[Incomplete]: ... | ||
def err1( | ||
self, | ||
x: Incomplete, # Y065 Leave parameter "x" unannotated rather than using "Incomplete" | ||
) -> None: ... | ||
def err2( | ||
self, | ||
) -> ( | ||
Incomplete # Y065 Leave return type unannotated rather than using "Incomplete" | ||
): ... | ||
def __getattr__( | ||
self, name: str | ||
) -> Incomplete: ... # allowed in __getattr__ return type | ||
|
||
class Bar: | ||
def __getattr__( | ||
self, | ||
name: Incomplete, # Y065 Leave parameter "name" unannotated rather than using "Incomplete" | ||
) -> Incomplete: ... | ||
|
||
def __getattr__(name: str) -> Incomplete: ... # allowed in __getattr__ return type |