Skip to content

gh-140715: provide support for %F token in strptime; add test for it and %T - #140647

Merged
encukou merged 29 commits into
python:mainfrom
jyalim:fix-issue-140644
Feb 9, 2026
Merged

gh-140715: provide support for %F token in strptime; add test for it and %T#140647
encukou merged 29 commits into
python:mainfrom
jyalim:fix-issue-140644

Conversation

@jyalim

@jyalimjyalim commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

Incrementally builds C99+ datetime support with addition of %F with single line of code. Also adds two tests: one for %F and another for previously supported %T.

Passed all tests (especially changes to new one).

Passed patchcheck.

@bedevere-app

Copy link
Copy Markdown

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 skip news label instead.

@python-cla-bot

python-cla-botBot commented Oct 27, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Comment threadLib/_strptime.py Outdated
Comment threadMisc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140644.WkozE0.rst Outdated
Comment threadLib/test/test_strptime.py Outdated
@StanFromIrelandStanFromIreland changed the title gh-140644: provide support for %F token in strptime; add test for it and %Tgh-140715: provide support for %F token in strptime; add test for it and %TOct 28, 2025
@StanFromIreland

Copy link
Copy Markdown
Member

I moved this under #140715, can you please update the blurb filename.

jyalimand others added 3 commits October 28, 2025 14:10
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…kozE0.rst
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@jyalim

Copy link
Copy Markdown
ContributorAuthor

I moved this under #140715, can you please update the blurb filename.

I think this is done!

Comment threadLib/test/test_strptime.py Outdated
Comment threadLib/test/test_strptime.py Outdated
Comment threadMisc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140715.WkozE0.rst Outdated

@StanFromIrelandStanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add them to this tuple:

fordirectivein ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
'j', 'm', 'M', 'p', 'S',
'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):

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 :-)

Comment threadMisc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140715.WkozE0.rst Outdated
Comment threadMisc/NEWS.d/next/Library/2025-10-27-00-13-04.gh-issue-140715.WkozE0.rst Outdated
Comment threadLib/test/test_strptime.py Outdated
Comment threadLib/test/test_strptime.py Outdated
Comment threadLib/test/datetimetester.py Outdated
Comment threadLib/test/datetimetester.py Outdated
Comment threadLib/test/datetimetester.py Outdated
jyalimand others added 7 commits February 7, 2026 15:24
…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>
@jyalim

Copy link
Copy Markdown
ContributorAuthor

Thank you, @StanFromIreland, all changes have been made as requested!

Comment threadDoc/library/datetime.rst Outdated
Comment threadDoc/library/datetime.rst Outdated
@jyalim

Copy link
Copy Markdown
ContributorAuthor

Thank you again, @StanFromIreland, changes have been made.

@StanFromIrelandStanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last few things.

Comment threadDoc/library/datetime.rst Outdated
Comment threadDoc/library/datetime.rst Outdated
Comment threadLib/test/datetimetester.py Outdated
Comment threadLib/test/datetimetester.py Outdated
Comment threadLib/test/test_strptime.py Outdated
Comment threadLib/test/test_strptime.py Outdated
Comment threadLib/test/datetimetester.py Outdated
Comment threadLib/test/datetimetester.py Outdated
jyalimand others added 7 commits February 8, 2026 13:30
style alignment, add space after function arguments as requested
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
style alignment, add space after function arguments as requested
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
fix punctuation in docs, as requested
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
fix punctuation in docs, as requested
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
style alignment, space after functional argument, as requested
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
style alignment, space after functional argument, as requested
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@jyalim

Copy link
Copy Markdown
ContributorAuthor

Thanks, @StanFromIreland, the requested changes were implemented!

Comment threadLib/test/datetimetester.py

@StanFromIrelandStanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@encukou
encukou merged commit d99f3fc into python:mainFeb 9, 2026
51 checks passed
@StanFromIreland

Copy link
Copy Markdown
Member

Thanks @jyalim, and congratulations for your first PR! Do you want to open a PR for one of the other format codes?

@jyalim

Copy link
Copy Markdown
ContributorAuthor

It was a pleasure working with you, and it sounds fun! How would you prefer to organize the effort, just to link under issue: #140715?

@StanFromIreland

Copy link
Copy Markdown
Member

Yes that sounds good!

thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
…GH-140647)
Also: add tests for the `%T` format code
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…GH-140647)
Also: add tests for the `%T` format code
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jyalim@StanFromIreland@encukou@nazeerali4325-commits