Message416408
I believe I'm elaborating on your "footgun".
It doesn't matter to me whether we pick some scheme and document it, _if_ that scheme is incoherent, impossible to remember, error-prone, etc.
That's how, e.g., regular expression syntax was designed. "I know! ++*??+) doesn't have a coherent meaning now, so let's say it means to match a prime number of the pattern it follows" ;-)
That is, an error-prone extension is worse than no extension at all.
The algorithm now isn't guessing at anything: it's saying up front that two tasks are the same task if and only if they compare equal. Context, execution history, ..., nothing else is relevant. It's simple. Complicating a simple thing may open new possibilities, but creates new traps too.
One trap is pretty obviously making "the rules" for when two tasks are the same task depend on the execution history at the time the question is asked.
That goes away, though, if the current rule is retained ("the same iff =="), but can be explicitly overridden by .forget() (or some such).
That doesn't make it a no-brainer, though. For example, do
.add(A, B)
and run until A and B are marked done. Now do
.add(B, C)
What then? We're back in a guessing game again. We've just been told that B depends on C first. But we already did B. Depending on _domain_ knowledge we cannot have, that may or may not be worthy of raising an exception.
You can make up any rule you want about that and arbitrarily declare victory, but the chance that a user will realize it's not the behavior _their_ domain needs is approximately 0 until after they've been burned by it. So now it's error-prone, at least to them.
FWIW, in that specific case I'd say "tough beans - you told us too late that B depends on C to stop B the first time, but now that you've told us we'll respect it in future".
Another twist: assuming that's "the rule", what does
.add(B, C)
really mean? If B really is "the same task" as it was the first time around, well, it's already been marked done. Are we supposed to do it _again_ now? Why? Why not?
It's hard for me to find any _compelling_ sense here - just masses of more-or-less arbitrary implementation decisions. In which case "hard to remember" follows soon after.
None of that haunts the current API. It all follows quite directly from what "depends on" means to essentially everyone. |
|
Date |
User |
Action |
Args |
2022-03-31 00:57:07 | tim.peters | set | recipients:
+ tim.peters, larry, eric.smith, pablogsal, Dennis Sweeney |
2022-03-31 00:57:07 | tim.peters | set | messageid: <1648688227.76.0.955875374277.issue47145@roundup.psfhosted.org> |
2022-03-31 00:57:07 | tim.peters | link | issue47145 messages |
2022-03-31 00:57:07 | tim.peters | create | |
|