3 ms·
I can't conceive where this would be useful, could you expand on this?
by davnn 4y ago
I can't conceive where this would be useful, could you expand on this?
- lozenge 4y agoIt's more likely to be listDir(withSizes=False) I work on a very large codebase like this and most functions return lists of strings/tuples and most DTOs will be dictionaries with string keys. Instead of classes which have methods to retrieve information in different ways. Therefore parameters have been added to return information in more and more ways.
- goodoldneon 4y agoI 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