@treyhunner @datamancer Strong agree. Sometimes it makes sense for a function to accept an iterable. Sometimes a list of arguments is a better fit. Those are both valid patterns. But I've never see a case where I'd want one function to handle both patterns.
Conversation
Notices
-
Embed this notice
Tek say resist (tek@freeradical.zone)'s status on Wednesday, 01-Jan-2025 06:20:10 JST Tek say resist
-
Embed this notice
Trey Hunner ? (treyhunner@mastodon.social)'s status on Wednesday, 01-Jan-2025 06:20:11 JST Trey Hunner ?
@datamancer I'd make them two separate functions if you find yourself particularly wanting both styles.
You could even get fancy and attach one function as an attribute of the other like itertools.chain and itertools.chain.from_iterable (technically chain is a implement as a class but the same could work for functions).
-
Embed this notice