mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
More precise type for TypeAliasType.__getitem__ (#12354)
At runtime, this always returns a GenericAlias; see typealias_subscript in Objects/typevarobject.c. See microsoft/pyright#8444.
This commit is contained in:
@@ -403,6 +403,7 @@ else:
|
||||
# It's writable on types, but not on instances of TypeAliasType.
|
||||
@property
|
||||
def __module__(self) -> str | None: ... # type: ignore[override]
|
||||
# Returns typing._GenericAlias, which isn't stubbed.
|
||||
def __getitem__(self, parameters: Any) -> Any: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
|
||||
Reference in New Issue
Block a user