gh-140715: provide support for %F token in strptime; add test for it and %T#140647
gh-140715: provide support for %F token in strptime; add test for it and %T#140647jyalim wants to merge 21 commits intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Misc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140644.WkozE0.rst
Outdated
Show resolved
Hide resolved
|
I moved this under #140715, can you please update the blurb filename. |
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…kozE0.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
I think this is done! |
Misc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140715.WkozE0.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
StanFromIreland
left a comment
There was a problem hiding this comment.
Please add them to this tuple:
Lines 361 to 363 in a2495ff
Also, please update the docs removing the (0) note from its row.
The implementation looks good, just a few small things and this will be ready :-)
Misc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140715.WkozE0.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140715.WkozE0.rst
Outdated
Show resolved
Hide resolved
…kozE0.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Remove extra comments Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
shorten test name Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
shorten test function name Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
Thank you, @StanFromIreland, all changes have been made as requested! |
|
Thank you again, @StanFromIreland, changes have been made. |
| @@ -2676,7 +2676,7 @@ differences between platforms in handling of unsupported format specifiers. | |||
| ``%:z`` was added for :meth:`~.datetime.strftime` | |||
There was a problem hiding this comment.
| ``%:z`` was added for :meth:`~.datetime.strftime` | |
| ``%:z`` was added for :meth:`~.datetime.strftime`. |
|
|
||
| .. versionadded:: 3.15 | ||
| ``%:z`` was added for :meth:`~.datetime.strptime` | ||
| ``%:z`` and ``%F`` were added for :meth:`~.datetime.strptime` |
There was a problem hiding this comment.
| ``%:z`` and ``%F`` were added for :meth:`~.datetime.strptime` | |
| ``%:z`` and ``%F`` were added for :meth:`~.datetime.strptime`. |
| datetime.strptime(test_date,"%F"), | ||
| datetime.strptime(test_date,"%Y-%m-%d") |
There was a problem hiding this comment.
| datetime.strptime(test_date,"%F"), | |
| datetime.strptime(test_date,"%Y-%m-%d") | |
| datetime.strptime(test_date, "%F"), | |
| datetime.strptime(test_date, "%Y-%m-%d") |
| datetime.strptime(test_time,"%T"), | ||
| datetime.strptime(test_time,"%H:%M:%S") |
There was a problem hiding this comment.
| datetime.strptime(test_time,"%T"), | |
| datetime.strptime(test_time,"%H:%M:%S") | |
| datetime.strptime(test_time, "%T"), | |
| datetime.strptime(test_time, "%H:%M:%S") |
| time.strptime(test_date,"%F"), | ||
| time.strptime(test_date,"%Y-%m-%d") |
There was a problem hiding this comment.
| time.strptime(test_date,"%F"), | |
| time.strptime(test_date,"%Y-%m-%d") | |
| time.strptime(test_date, "%F"), | |
| time.strptime(test_date, "%Y-%m-%d") |
| time.strptime(test_time,"%T"), | ||
| time.strptime(test_time,"%H:%M:%S") |
There was a problem hiding this comment.
| time.strptime(test_time,"%T"), | |
| time.strptime(test_time,"%H:%M:%S") | |
| time.strptime(test_time, "%T"), | |
| time.strptime(test_time, "%H:%M:%S") |
| date.strptime('20-03-14', '%y-%m-%d') | ||
| date.strptime('02-29,2024', '%m-%d,%Y') | ||
|
|
||
| def test_strptime_F_format(self): |
There was a problem hiding this comment.
Please move under TestDate (using self.theclass.strptime).
| datetime.strptime(test_date,"%Y-%m-%d") | ||
| ) | ||
|
|
||
| def test_strptime_T_format(self): |
There was a problem hiding this comment.
Please move to TestDateTime and use self.theclass.strptime.
Incrementally builds C99+ datetime support with addition of
%Fwith single line of code. Also adds two tests: one for%Fand another for previously supported%T.Passed all tests (especially changes to new one).
Passed patchcheck.
strptimetoken support and documentation modernization #140644str*timeto C11 format codes #140715