New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use datetime in _strptime #38035
Comments
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. |
Logged In: YES Brett, is there any doc for the functions that were removed? Otherwise, the patch seemed fine (but I didn't look that |
Logged In: YES 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. |
Logged In: YES Meta comment - I think that when uploading successive patches it's useful Comment comment - Unless there's some evidence the elided functions |
Logged In: YES 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. |
Logged In: YES Applied patch as: Lib/_strptime.py 1.13 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: