KEMBAR78
gh-112451: Make C-extension datetime.timezone acceptable as a base class. by felixxm · Pull Request #112518 · python/cpython · GitHub
Skip to content

Conversation

@felixxm
Copy link
Contributor

@felixxm felixxm commented Nov 29, 2023

Should we implement tp_alloc for datetime.timezone? 🤔 Can do if it's required.

@erlend-aasland
Copy link
Contributor

Should we implement tp_alloc for datetime.timezone? 🤔 Can do if it's required.

I don't think there is a need to override the default allocator. cc. @pganssle

@felixxm
Copy link
Contributor Author

felixxm commented Jan 15, 2024

Rebased, in case it helps 😄

class MyTimezone(_datetime.timezone):
pass

self.assertIs(issubclass(MyTimezone, _datetime.timezone), True)
Copy link
Member

Choose a reason for hiding this comment

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

Test that MyTimezone(...) returns a MyTimezone instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not 😞 Thanks for finding this 🎯

@felixxm
Copy link
Contributor Author

felixxm commented Jan 17, 2024

Closing per discussion in #112451.

@felixxm felixxm closed this Jan 17, 2024
@felixxm felixxm deleted the gh-112451 branch January 17, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants