4 ms·
I usually see it for things like “return_generator”. Then you need to write an overloaded signature to show that it could return a list or generator depending o
by goodoldneon 4y ago
I usually see it for things like “return_generator”. Then you need to write an overloaded signature to show that it could return a list or generator depending on that param.
Then it’s even worse when there’s also an “allow_raise” param, where the return type will not be None if allow_raise=True. Now you need to write 4 overloaded signatures to account for the 2 polymorphic params