gh-140715: Add %t and %n format codes support to strptime()#144896
gh-140715: Add %t and %n format codes support to strptime()#144896jyalim wants to merge 27 commits intopython:mainfrom
Conversation
StanFromIreland
left a comment
There was a problem hiding this comment.
This is quite an odd case, as per the standard for strftime, it is a \t character, however, for strptime():
And, more straightforward:
Considering that this is the wide-spread behaviour, it should instead be r'\s+' for %n/%t (with additional tests), and add a note to the doc.
|
Thanks, this was a great catch that adds some power to |
|
Thank you, the documentation changes were implemented. |
StanFromIreland
left a comment
There was a problem hiding this comment.
We could also do \n now, since it is equivalent. (re-use the tests please)
typo fix Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
remove trailing whitespace Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
Thanks! All the requested changes were implemented. The title and description of this PR were also updated to include |
|
Thank you, the tests have been merged and all requested changes have been implemented. |
Misc/NEWS.d/next/Library/2026-02-17-03-43-07.gh-issue-140715.twmcM_.rst
Outdated
Show resolved
Hide resolved
clarify "arbitrary" with "zero or more" Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
clarify "arbitrary" with "zero or more" Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…wmcM_.rst Drop quotes around format directives Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
Something broke with the CI, I'll try updating the branch. |
|
Thanks! Changes have been made. |
Incrementally builds C99+ datetime support with addition of
%tand%nwith two lines of code. Also adds tests and updates documentation.Continued effort from PR: #140647 , #144819.
Documentation drops (0) footnote.
Passed all tests.
Passed patchcheck.
Issue: #140715
str*timeto C11 format codes #140715Note, this PR originally only was for
%t;%nwas added 2026-02-25.📚 Documentation preview 📚: https://cpython-previews--144896.org.readthedocs.build/