Replies: 2 comments
-
I'm never developed a user-facing package so I'm not quite sure. It's definitely an interesting UX/DX issue. What I know for sure:
Some random thoughts (these could all be individual issues):
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your detailed message @mjkanji 🙏🏻
Agree, it’s a breaking change, so it will need to be bundled in the next minor version update (1.5.0). The good thing is that it doesn’t modify silently the behavior of the affected existing code; it simply makes it break.
Current typing forbids to pass a
Interesting, I will take more time to think about this
but in at the same time |
Beta Was this translation helpful? Give feedback.
-
@mjkanji Following up on our discussion in #57 and #58.
We have operations for which the behavior is hopefully intuitive when passing zero arguments:
flatten()
.observe()
.group()
-> groups all the elements together into a single list.distinct()
-> deduplication on elements themselves, like.distinct(key=lambda _: _)
..filter()
-> filter truthy elems, like.filter(None)
or.filter(lambda _: _)
We have operations for which there is no intuitive behavior when passing zero arguments and the first positional argument should be mandatory:
.foreach()
(applies what?).aforeach()
(applies what?).map()
(maps what?).amap()
(maps what?).groupby()
(groups by what?).catch()
(catches nothing? catches everything?)no-op
.throttle()
and also.truncate()
/.skip()
after #59, are valid and no-op, but while intentional.truncate(None)
and.skip(None)
make sense to be no-op,.truncate()
/.skip()
/.throttle()
are more likely developer mistakes that need to be notified via an error, right?Beta Was this translation helpful? Give feedback.
All reactions