-
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.
feat: Correct stubs for TypeVars (#67)
Closes #63 ### Summary of Changes TypeVars create correct stubs. --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
- Loading branch information
1 parent
216e179
commit df8c5c9
Showing
16 changed files
with
365 additions
and
132 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,30 @@ | ||
from typing import TypeVar, Generic | ||
|
||
T = TypeVar('T') | ||
|
||
|
||
class TypeVarClass(Generic[T]): | ||
type_var = TypeVar("type_var") | ||
|
||
def __init__(self, items: list[T]): ... | ||
|
||
def type_var_class_method(self, a: T) -> T: ... | ||
|
||
|
||
class TypeVarClass2(Generic[T]): | ||
type_var = TypeVar("type_var") | ||
|
||
def type_var_class_method2(self, a: T) -> T: ... | ||
|
||
|
||
_type_var = TypeVar("_type_var") | ||
def type_var_func(a: list[_type_var]) -> list[_type_var]: ... | ||
|
||
|
||
_type_var1 = TypeVar("_type_var1") | ||
_type_var2 = TypeVar("_type_var2") | ||
def multiple_type_var(a: _type_var1, b: _type_var2) -> list[_type_var1 | _type_var2]: ... | ||
|
||
|
||
T_in = TypeVar("T_in", bound=int) | ||
def type_var_fun_invariance_with_bound(a: list[T_in]) -> T_in: ... |
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
Oops, something went wrong.