-
Hi, I have a union type that is defined using the Exampleclass MyProtocol(typing.Protocol):
def method(self, arg: int) -> MyType: ...
class A[T: MyType]:
def __init__(self, value: T) -> None:
pass
class B:
pass
type MyType = A[MyType] | B # for example, not my actual case
class MyClass(MyProtocol):
def met│
# ^ cursor - tab is pressed here Expectedclass MyClass(MyProtocol):
def method(self, arg: int) -> MyType:
return super().method(arg)│ Actualclass MyClass(MyProtocol):
def method(self, arg: int) -> A[... | B] | B:
return super().method(arg)│ (imports omitted for brevity) ConfigurationPylance v2024.7.1 |
Beta Was this translation helpful? Give feedback.
Answered by
rchiodo
Aug 5, 2024
Replies: 1 comment 1 reply
-
I think this is an issue we already have: Which was turned into this discussion item: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
qexat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this is an issue we already have:
#5464
Which was turned into this discussion item:
#6172