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
datetime types don't work as bases #38298
Comments
This is probably shallow. Assigned to Guido in case >>> from datetime import *
>>> class C(date):
... def whatever(self):
... return "oops"
>>> c = C(2002, 1, 1)
>>> c.whatever()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'datetime.date' object has no
attribute 'whatever'
>>> type(c)
<type 'datetime.date'>
>>> Was reported on c.l.py. |
Logged In: YES Well, one shallow thing becomes obvious when you write |
Logged In: YES Here's a strawman fix. It makes 'date' a properly |
Logged In: YES I think the date enhancement is fine -- check it in! I'd leave off |
Logged In: YES Done; the rest is up to you! |
Logged In: YES I checked in changes (for 2.3b2) so that time, datetime, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: