[Patches] [ python-Patches-691928 ] Use datetime in _strptime

SourceForge.net noreply@sourceforge.net
Mon, 03 Mar 2003 13:14:53 -0800


Patches item #691928, was opened at 2003-02-23 16:07
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=691928&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brett Cannon (bcannon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Use datetime in _strptime

Initial Comment:
To prevent code duplication, I patched _strptime to use datetime's date object to do Julian day, Gregorian, and day of the week calculations (Tim's code has to be more reliable than mine  =).  Patch also includes new regression tests to test results and calculation gets triggered.

Very minor comment changes and my contact email are also changed.

----------------------------------------------------------------------

>Comment By: Brett Cannon (bcannon)
Date: 2003-03-03 13:14

Message:
Logged In: YES 
user_id=357491

Response to meta comment - I would normally delete it, Skip, but last time I tried I was told I didn't have the proper rights to do it.  Unless SF has changed their setup to allow patch creators to manage the files regardless of whether they have CVS access I can't.

Response to comment comment - The reason I am doing this is that I want to make sure that the returned time tuple is a valid date.  If strptime is going to have default values I want those values to lead to a valid time that does not require someone to have to do more processing or wonder whether it is valid.

Now currently the docs say you can't expect anything back in the time tuple but what was in the data string, so doing this does not go against the docs.  But if strptime becomes the only strptime implementation, then I will write a doc patch to make the docs say that all returned time tuples will be valid dates.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2003-03-03 07:03

Message:
Logged In: YES 
user_id=44345

Meta comment - I think that when uploading successive patches it's useful
to either name them differently or delete the prior one to avoid confusion.
In this case it's not a big deal, especially since the submission dates are
different, but after a few revisions it can sometimes be a challenge to
figure out which patch should be downloaded.
 
Comment comment - Unless there's some evidence the elided functions
have been used, I suspect it best to just let people use the relevant
datetime functions.

----------------------------------------------------------------------

Comment By: Brett Cannon (bcannon)
Date: 2003-02-25 13:51

Message:
Logged In: YES 
user_id=357491

Only in the module (which was removed).  None of the helper functions have ever been publicly advertised (although I think the locale date info might be helpful in locale; MvL wasn't interested, though).

I uploaded a new diff that removes one more line that I forgot to remove when I eliminated the ability to pass in a regex object.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-23 16:56

Message:
Logged In: YES 
user_id=33168

Brett, is there any doc for the functions that were removed?
   firstjulian, gregorian, julianday, dayofweek

Otherwise, the patch seemed fine (but I didn't look that
closely).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=691928&group_id=5470