-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Remove TODO comment in _pydatetime._isoweek1monday #127553
Copy link
Copy link
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Projects
Status
Done
Status
Todo
Feature or enhancement
Proposal:
According to the existing note
# XXX This could be done more efficiently, the_isoweek1mondayfunction can be improved.Current Implementation:
Proposed Change
Replace the current implementation with a simplified logic that is both more performant and easier to understand.
Rationale
The new logic:
1. Aligns directly with the ISO week definition, which makes it easier to comprehend.
2. Reduces unnecessary computations, improving performance slightly.
Validation and Performance Comparison
Using timeit to compare the current and proposed implementations:
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
TODOcomment in_pydatetime._isoweek1monday#127564