`consumer` return type -- Does `Callable[..., ` work better than `Callable[P, `?
Closed this issue · 2 comments
cboulay commented
(very low priority)
I find that when I wrap generator functions with @consumer
, the IDE warns me that any arguments to initialize the generator are unexpected.
However, if I change consumer's return type as follows...
def consumer(
func: Callable[P, Generator[Y, S, None]]
) -> Callable[..., Generator[Y, S, None]]:
then the IDE no longer flags the arguments as unexpected.
I don't know if this has any downstream effects. e.g., I guess this might impact pickling.
griffinmilsap commented
cboulay commented
OK then it's fine as is. Thanks for checking.