Skip to content

Fix datetime constructor and method signature metadata - #9532

Merged
youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:fix/datetime-signatures-20261102
Nov 3, 2026
Merged

youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:fix/datetime-signatures-20261102

Conversation

@youknowdot

@youknowdot youknowdot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Address the 13 datetime inspect.signature differences in the actual Ubuntu report from #9530:

  • Supply the existing public defaults for timedelta, time.isoformat, datetime.isoformat, datetime.fromtimestamp, and datetime.astimezone.
  • Use the existing typed argument structs for date, time, and datetime constructor signatures. Keep raw pickle-state handling in slot_new, before normal argument binding.
  • Match the positional-only parameter names of fromisoformat and __format__.
  • Enable --signature output in the existing CI whats_left step, using the reviewed one-line diagnostic change from Align builtin signatures exposed by whats_left #9530. It prints results already computed by that step; imports, builds, and scans are unchanged.

The constructor refactor preserves normal binding, pickle positional/keyword behavior, subclass wrapping, and argument destruction before instance allocation. No handwritten signature override, shared binder/parser change, Lib edit, or test expectation change is included.

Evidence

The comparison is against CPython 3.15.0 Clinic declarations and native constructor/default handling. Like CPython, missing native arguments can retain a sentinel while exposing their documented zero, None, or 'auto' default.

The source report measures normalized inspect.signature, not byte-for-byte raw __text_signature__. All 13 entries have a corresponding source correction here; their disappearance still needs runtime confirmation on this head.

Validation

  • Independent source review, configured pre-commit hooks, and git diff --check: passed.
  • Local compilation, interpreter tests, Rust tests, and clippy: not run; local dependency cache/bootstrap limitations remain.
  • Existing CI is the runtime validation gate, particularly test_datetime, existing datetime snippets, and the whats_left signature report. Draft pending that evidence.

AI assistance: OpenAI Codex performed investigation, implementation, and source review; runtime limitations are disclosed above.

Address the 13 datetime inspect.signature discrepancies in the actual whats_left report against CPython 3.15. Keep constructor pickle handling before normal typed binding, preserving argument destruction and subclass wrapping. Supply truthful defaults and positional parameter names. Independent source review and normal hooks passed; local compilation and runtime verification remain unavailable.

Assisted-by: OpenAI Codex:model version not exposed
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

Use the reviewed one-line diagnostic option from RustPython#9530 so this datetime follow-up can verify the actual 13 reported differences on its own CI head. This only enables printing comparison results already computed by the existing whats_left step; imports, builds, scans, and test behavior are unchanged.

Assisted-by: OpenAI Codex:model version not exposed
@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:fix/datetime-signatures-20261102 (456d257) with main (ef023bc)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@youknowone
youknowone marked this pull request as ready for review November 3, 2026 01:01
@youknowone
youknowone merged commit feff65d into RustPython:main Nov 3, 2026
29 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T01:05:52.576055Z 456d257 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to 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.

3 participants