bear/parsedatetime — pull request #35 by sashaacker (2014-03-12 00:31:58+00:00)
Title: Its 2014, Why a time tuple?

While I do understand that this is an older package, datetime was added to the standard library on 29 Jul 2003 (2.3, over 10 years ago), and this package even depends on a version of python even newer than this (2.6). And while it is not too much of an annoyance to expand arguments of a time tuple into a datetime object... Why is that even something one should have to do nowadays?

I am not advocating going in and breaking everyone else's code. What I am suggesting is a path to deprecate the time tuple in favor of returning a datetime.

The suggested path would be, in my view, as follows:

* In a future release, add a keyword argument 'datetime', set by default to False. This argument would swap the tuple for a datetime object.
* In a subsequent release, keep the value set to False by default, and issue a deprecation warning.
* In a third subsequent release, change the default value to True.

After this, returning of a time tuple can be completely removed, as those few who actually need it, can call the .timetuple method on a datetime object.

As an aside, you would not need to use a return code with datetime objects - type inference would be enough. (return None instead of (..., 0), a datetime.date for date, datetime.time for time, and datetime.datetime for datetime.)