You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
First: Thanks for writing and publishing a cool package!
I started using todotxtio for a little project of mine where I needed something to parse my todo.txt and while playing around with it I noticed that Todo objects are not comparable and thus can't easily be sorted using list.sort() or sorted(). Since this was functionality I was missing I implemented a very rough and NOT production/pull ready sketch of this using functools total_ordering decorator.
Only afterwards I read Issue #2, which I interpret to mean that not adding comparability was intentional and so I figured I open up a new issue and, well, ask:
Is the fact that Todo objects are not comparable to each other the way things are supposed to work or would you accept a PR to add that functionality?
The text was updated successfully, but these errors were encountered:
lordminx
changed the title
Make todos comparable to allow for sorting?
Make Todo's comparable to allow for sorting?
Mar 7, 2018
Hi Lordminx and thank you for your interest in Todo.txt I/O!
Only afterwards I read Issue #2, which I interpret to mean that not adding comparability was intentional and so I figured I open up a new issue and, well, ask:
Is the fact that Todo objects are not comparable to each other the way things are supposed to work or would you accept a PR to add that functionality?
That's a good question. When I was developing Web Todo.txt I figured out it was easier to sort tasks on the client-side rather than in the server-side (in fact, it was useless to sort those tasks server-side because the client-side may change the order of the tasks for several reasons at any time without making any request to get a frest tasks list).
Of course there isn't any reason a list of Todo objects cannot be sorted using native Python methods. So yes, your PR is welcome!
First: Thanks for writing and publishing a cool package!
I started using todotxtio for a little project of mine where I needed something to parse my todo.txt and while playing around with it I noticed that
Todo
objects are not comparable and thus can't easily be sorted usinglist.sort()
orsorted()
. Since this was functionality I was missing I implemented a very rough and NOT production/pull ready sketch of this using functoolstotal_ordering
decorator.Only afterwards I read Issue #2, which I interpret to mean that not adding comparability was intentional and so I figured I open up a new issue and, well, ask:
Is the fact that
Todo
objects are not comparable to each other the way things are supposed to work or would you accept a PR to add that functionality?The text was updated successfully, but these errors were encountered: