I tried to make Date.parse(...) a replacement for get_canonical_date(...) so that string == str(Date.parse(string)).
The difference between Date.parse and Date.__init__ is that parse() checks a lot more possible formats, while __init__() expects simpler input and also recognizes various objects like datetime. __init__() is more for internal use (hopefully also faster, though I haven't checked...) To handle more formats (e.g. alien ones belonging to various remote backends), I would extend parse() and keep __init__() as-is. They are about equivalent, but I think it is easier to add more constants like TODAY, SOON, etc. than to subclass Date. This way, any new fuzzy dates will have to behave in a way that is consistent with the existing ones. -- https://code.launchpad.net/~gtg-contributors/gtg/new-date-class/+merge/28009 Your team Gtg developers is requested to review the proposed merge of lp:~gtg-contributors/gtg/new-date-class into lp:gtg. _______________________________________________ Mailing list: https://launchpad.net/~gtg Post to : gtg@lists.launchpad.net Unsubscribe : https://launchpad.net/~gtg More help : https://help.launchpad.net/ListHelp