Fix datetime.datetime not supporting __class_getitem__ in runtime context#29
Fix datetime.datetime not supporting __class_getitem__ in runtime context#29
Conversation
Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
… tests Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
|
@copilot Please add this only to datetime class, not to others in datetime module. |
Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
Done. I've updated the implementation to add Commit: aa78e5f |
|
@copilot Is there any change in the documentation needed? |
Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
Yes, I've added documentation for this feature. The datetime.rst file now includes a Commit: 3eeeb02 |
…H-143076) Add the unicodedata.iter_graphemes() function to iterate over grapheme clusters according to rules defined in Unicode Standard Annex #29. Add unicodedata.grapheme_cluster_break(), unicodedata.indic_conjunct_break() and unicodedata.extended_pictographic() functions to get the properties of the character which are related to the above algorithm. Co-authored-by: Guillaume "Vermeille" Sanchez <guillaume.v.sanchez@gmail.com>
|
@copilot Please update an example and test with generic over tzinfo instead of int |
Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
Done. I've updated the documentation example to use Commit: ffa9326 |
Plan: Add class_getitem support to datetime class
Summary
This PR adds
__class_getitem__support to thedatetime.datetimeclass only, as requested. This enables the datetime class to be used with generic type syntax at runtime (e.g.,datetime.datetime[tzinfo]).The implementation:
__class_getitem__to datetime.datetime in both C and pure Python implementationsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.