This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sergem
Recipients sergem
Date 2016-12-05.12:52:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480942340.78.0.750693942086.issue28878@psf.upfronthosting.co.za>
In-reply-to
Content
I have Python 3.5.2.

datetime is implemented as a subclass of date
(isinstance(datetime.datetime(2015,1,1), datetime.date) == True)

I suppose that violates Liskov substitution principle:

1. datetime and date cannot be compared via "<".
2. both of these classes have "isoformat()" method. And the meaning of these methods differ.

It means one cannot pass datetime to the function that expects date.

Also one cannot say that datetime "is a" date. 

I suppose datetime must not be a subclass of date.
History
Date User Action Args
2016-12-05 12:52:20sergemsetrecipients: + sergem
2016-12-05 12:52:20sergemsetmessageid: <1480942340.78.0.750693942086.issue28878@psf.upfronthosting.co.za>
2016-12-05 12:52:20sergemlinkissue28878 messages
2016-12-05 12:52:20sergemcreate