Hi guys,
I was wondering: When looking at the overload variants of groupby_transform in the more.pyi module, the return type annotation is sometimes Iterator, sometimes Iterable. Whereas, judging by the implementation it should always be an Iterator.
The return type annotation is Iterable whenever at least one of the arguments value_func or reduce_func is not None. I.e. the actual return type will then be a generator expression instead of the raw result of groupby (by the implementation). But generator expressions are also Iterators not only Iterables.
So this is more of a question, is there any reason to annotate it as Iterable instead?
Hi guys,
I was wondering: When looking at the overload variants of
groupby_transformin themore.pyimodule, the return type annotation is sometimesIterator, sometimesIterable. Whereas, judging by the implementation it should always be anIterator.The return type annotation is
Iterablewhenever at least one of the argumentsvalue_funcorreduce_funcis notNone. I.e. the actual return type will then be a generator expression instead of the raw result ofgroupby(by the implementation). But generator expressions are alsoIterators not onlyIterables.So this is more of a question, is there any reason to annotate it as
Iterableinstead?