mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-71002 PEP-696: Add a set of tests that covers PEP's functionality
GitOrigin-RevId: 5d14970b62451233e8852df77a6938a18b3a17b9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cedd61e338
commit
6279c7a3c0
@@ -0,0 +1,6 @@
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
T = TypeVar('T', default=int)
|
||||
|
||||
class StackOfIntsByDefault(Generic[T]):
|
||||
def pop(self) -> T: ...
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
T = TypeVar('T', default=int)
|
||||
U = TypeVar('U', default=str)
|
||||
|
||||
class Box(Generic[T, U]):
|
||||
val: T | U
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
T = TypeVar('T', default=int)
|
||||
|
||||
class StackOfIntsByDefault(Generic[T]):
|
||||
def pop(self) -> T: ...
|
||||
@@ -0,0 +1,2 @@
|
||||
class StackOfIntsByDefault[T = int]:
|
||||
def pop(self) -> T: ...
|
||||
@@ -0,0 +1,4 @@
|
||||
from typing import TypeVar, TypeAlias
|
||||
T = TypeVar('T', default = int)
|
||||
U = TypeVar('U', default = str)
|
||||
StrIntDict: TypeAlias = dict[T, U]
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
from typing import TypeVar, TypeAlias, Generic
|
||||
T = TypeVar('T')
|
||||
U = TypeVar('U')
|
||||
DefaultStrT = TypeVar('DefaultStrT', default = str)
|
||||
class SomethingWithNoDefaults(Generic[T, T2]): ...
|
||||
MyAlias: TypeAlias = SomethingWithNoDefaults[int, DefaultStrT]
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user