⚡ Sangsakala Proxy 🏠 Home
Skip to content

gh-161304: Add runtime generic alias support to datetime - #161305

Draft
m-aciek wants to merge 2 commits into
python:mainfrom
m-aciek:fix-datetime-class-getitem-issue
Draft

m-aciek wants to merge 2 commits into
python:mainfrom
m-aciek:fix-datetime-class-getitem-issue

Conversation

@m-aciek

@m-aciek m-aciek commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Following python/typeshed#11844, add a magic method __class_getitem__() to Python and C implementation of datetime, to allow generic aliases in typing.

Disclaimer: I used Copilot for development work (sorry for poor commit history).

Edit:

Per Sebastian's comment, marking the PR as draft for now.

(…) the change is new and hasn't made it into any type checkers yet (as far as I'm aware). It might turn out to be too controversial and might need backing out in typeshed (although I hope not). So I would wait maybe 1-2 months with this to make sure we keep the change in typeshed.

@python-cla-bot

python-cla-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Nov 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 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-04T09:43:37.204065Z 97b8343 PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97b8343153

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Doc/library/datetime.rst Resolved
@read-the-docs-community

read-the-docs-community Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35644458 | 📁 Comparing 7643e44 against main (405f127)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

@m-aciek
m-aciek marked this pull request as draft November 4, 2026 10:05
@m-aciek
m-aciek force-pushed the fix-datetime-class-getitem-issue branch from 942f53d to 881dcb4 Compare November 4, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant