GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
146 stars 27 forks source link

allow an empty string as the value for "wait"-like expressions #119

Open smemsh opened 2 years ago

smemsh commented 2 years ago

so we can pass empty value expressions to .filter() like to get effect of giving a -WAITING filter to TaskWarrior, eg with .filter(wait__none='')

Fixes #118

smemsh commented 2 years ago

this surely affects other things than wait because each one is normalized and deserialized differently

maybe the right way is to handle '' specially in _normalize() and _serialize() before the specific function is called (like None is) and just pass it through if encountered, since empty string could be useful for other things that are using .none or .any. That said, I don't use this myself for anything besides wait.none: at the current time so the more narrow patch is good enough for me personally

smemsh commented 1 year ago

(btw it seems wait.none: cannot be used alone to match -WAITING behavior, because it won't match a task with wait time in the past. would have to use wait.none: or wait.before:now to get equivalent of -WAITING. nonetheless, empty strings should still be passable and the patch should still be merged IMO)

smemsh commented 1 year ago

@tbabej since you did a release, should I conclude this patch will not be merged?