You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fromtimestamp does not call __new__ in datetime subclasses #76585
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:
assignee=Noneclosed_at=<Date2018-01-16.18:06:34.145>created_at=<Date2017-12-21.21:54:13.191>labels= ['3.7', '3.8']
title='fromtimestamp does not call __new__ in datetime subclasses'updated_at=<Date2018-01-16.18:06:34.144>user='https://github.com/pganssle'
In writing some tests for the alternate date constructors as part of my PR for bpo-32403 (https://bugs.python.org/issue32403), I noticed that for datetime, the fromtimestamp bypasses the __new__ call on the subclass:
Activity
pganssle commentedon Dec 21, 2017
In writing some tests for the alternate date constructors as part of my PR for bpo-32403 (https://bugs.python.org/issue32403), I noticed that for
datetime, thefromtimestampbypasses the__new__call on the subclass:Replacing
datetimewithdatein the above code we don't get a failure, but withdatetime, it fails with:Regardless of the status of 32403, I think this should be fixed (though I can try to fix them both at the same time).
abalkin commentedon Jan 16, 2018
New changeset 9f1b7b9 by Alexander Belopolsky (Paul Ganssle) in branch 'master':
bpo-32403: Faster date and datetime constructors (bpo-4993)
9f1b7b9