mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
PY-61883 PEP 695 Type Parameter Syntax: Make PyTypingTypeProvider aware of the new-style type parameters and aliases
Inherit PyTypeAliasStatement from PyQualifiedNameOwner to re-use type aliases stack in PyTypingTypeProvider Various tests for the changes above Co-authored-by: Mikhail Golubev <mikhail.golubev@jetbrains.com> GitOrigin-RevId: 242427c6f84c05ec48c94085f20675b8e30f8625
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0ca9ba4a99
commit
eb58a3805e
@@ -0,0 +1,4 @@
|
||||
from typing import Protocol
|
||||
|
||||
# classes having type parameter list implicitly inherit from typing.Generic
|
||||
class Clazz[T](Protocol): ...
|
||||
@@ -0,0 +1,3 @@
|
||||
class Stack[T]:
|
||||
def pop() -> T:
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo[T](x: T) -> T:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
type alias[T, U] = dict[T, U]
|
||||
@@ -0,0 +1,4 @@
|
||||
from typing import Callable
|
||||
|
||||
def changes_return_type_to_str[**P](x: Callable[P, int]) -> Callable[P, str]:
|
||||
...
|
||||
@@ -0,0 +1,3 @@
|
||||
from typing import List, Union
|
||||
|
||||
type MyType = Union[List['MyType'], int]
|
||||
@@ -0,0 +1,2 @@
|
||||
type alias2 = 'alias'
|
||||
type alias = alias2
|
||||
Reference in New Issue
Block a user