-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Description
Describe the Bug
I often use this pattern when writing a variadic __getitem__. It works at runtime, but Pyrefly does not like it:
from typing import *
class T: ...
def my_func(x: T | tuple[T,T]):
match x:
case T(),T(): # Type `T` is not iterable
print("Two T")
case T():
print("One T")
my_func(T())
my_func((T(),T()))
Sandbox Link
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels