Repository navigation
Declare nullable datetime defaults directly - #9559
Conversation
Use Option None for five timezone arguments, typed auto defaults for two timespec arguments, and a raw Python T default for the datetime separator. Preserve supplied separator validation in the method body, timezone checks, pickle constructors, and every unchanged/timedelta omission sentinel. Source-reviewed against CPython 3.15.0 d220409a13b77de7a6c30abe16ea90db01528edc. No test expectations or Lib files changed. Local native validation remains limited by the available dependency closure. Assisted-by: OpenAI Codex:model version not exposed
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Restore runtime defaults whose concrete literal lowering adds Python object creation, conversion, or reference management on omitted arguments. Keep only cost-preserving None default cleanup, where applicable. No test code or expectations changed. Assisted-by: OpenAI Codex:model version not exposed
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Declare five nullable datetime defaults with
Option<PyObjectRef>anddefault = None:time/datetimeconstructortzinfo, andnow,fromtimestamp,astimezonetz.Omission remains a native absent state. The three methods still create a None reference lazily at the same body fallback. Timezone validation, callback order and pickle-slot branches stay in their existing locations. Rendered signatures are unchanged; typed None metadata replaces Raw metadata.
The earlier three string-default changes have been restored. Both
timespecarguments and the datetime separator keep their Missing paths, which avoid default-object construction, string copying and separator validation work on omission. The other 25 sentinel/display overrides also remain unchanged.Reviewed against CPython 3.15.0 d220409a13b77de7a6c30abe16ea90db01528edc datetime source. This PR is independent of the other default-cleanup PRs.
Validation
1d5d31e42de8cefecb182d4f00d78a0e20e49cbf.test_datetime, were attempted offline on this head. All stopped before compilation because the pinnedparking_lot_coregit dependency is unavailable locally. No local native test pass is claimed.test_datetimeoutcomes on the three operating systems remain to be checked.AI-assisted implementation and review with OpenAI Codex; model version not exposed.
Summary by CodeRabbit
None, while retaining existing timezone handling when a value is provided.