4 ms·
Nothing prevents you to have a valid "not_yet_started" state.
by greatgib 2y ago
Nothing prevents you to have a valid "not_yet_started" state.
- int_19h 2y agoThis is basically equivalent to what null is for pointers, and has all the same problems.
- rcxdude 2y agoNo, but it does complicate things substantially. I don't understand why you would have a useless half-constructed state, especially in python where init isn't all that magical.
- lgas 2y agoThe benefits of making illegal states unrepresentable are just not widely understood outside of pure FP circles. I think it's hard for stuff like this to catch on in python in particular because everything is so accessible and mutable, it would be hard to talk about anything that provides the level of confidence that eg. ADTs in Haskell provide. And it's hard to understand why you would want to try to do something like that in a context like python unless you already have experience with it in a statically typed context.
- eptcyka 2y agoAnd what would you do with this object after construction? Call start() on it immediately?
- greatgib 2y agoKind of yes or no, depend on your usage. But clearly would have worked well for the case of the automatic test if the start was the context