Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-107773: Make datetime subclass repr consistent both implementations #130308

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Feb 19, 2025

New behavior:

>>> class A(_datetime.time): pass
...
>>> class B(_pydatetime.time): pass
...
>>> repr(A(1))
'A(1, 0)'
>>> repr(B(1)) # or str()
'B(1, 0)'

Old behavior:

>>> class A(_datetime.time): pass
...
>>> class B(_pydatetime.time): pass
...
>>> repr(A(1))
'A(1, 0)'
>>> repr(B(1)) # or str()
'__main__.B(1, 0)'

@mattip
Copy link
Contributor

mattip commented Feb 19, 2025

Might be nice to add the reproducer from #107773 as a test, if only to make sure this does not regress and that the C and Python implementations remain in sync.

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.

2 participants