-
Notifications
You must be signed in to change notification settings - Fork 201
Labels
Description
Describe the Bug
when using generics inside a contextmanager the generic is lost
from contextlib import contextmanager
from typing import Iterator
@contextmanager
def add_source_channel[T](source: list[T]) -> Iterator[list[T]]: ...
t: list[int] = [1]
m = add_source_channel(t) # not working -> _GeneratorContextManager[list[Unknown], None, None]
# should be _GeneratorContextManager[list[int], None, None]
def add_source_channel2[T](source: list[T]) -> Iterator[list[T]]: ...
m = add_source_channel2(t) # working just fineSandbox Link
(Only applicable for extension issues) IDE Information
No response