Message282416
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. |
|
Date |
User |
Action |
Args |
2016-12-05 12:52:20 | sergem | set | recipients:
+ sergem |
2016-12-05 12:52:20 | sergem | set | messageid: <1480942340.78.0.750693942086.issue28878@psf.upfronthosting.co.za> |
2016-12-05 12:52:20 | sergem | link | issue28878 messages |
2016-12-05 12:52:20 | sergem | create | |
|