[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2019-02-14 Thread Paul Ganssle
Change by Paul Ganssle : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2019-02-09 Thread Paul Ganssle
Paul Ganssle added the comment: This issue and bpo-32417 can be closed now, as they are fixed on master. -- versions: +Python 3.8 -Python 3.6, Python 3.7 ___ Python tracker __

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2019-02-08 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset d9503c307a8b6a7b73f6344183602ffb014d3356 by Łukasz Langa (Paul Ganssle) in branch 'master': Add What's New entry for date subclass behavior (#11790) https://github.com/python/cpython/commit/d9503c307a8b6a7b73f6344183602ffb014d3356 -- nosy

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2019-02-08 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +11794, 11795 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2019-02-08 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +11794 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2019-02-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New changeset 89427cd0feae25bbc8693abdccfa6a8c81a2689c by Alexander Belopolsky (Paul Ganssle) in branch 'master': bpo-32417: Make timedelta arithmetic respect subclasses (#10902) https://github.com/python/cpython/commit/89427cd0feae25bbc8693abdccfa6a8c8

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-04 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +10143 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-04 Thread Paul Ganssle
Paul Ganssle added the comment: Another thing to note: I'm pretty sure this was a mistake in the first place. There are many examples of places where the datetime module was just not designed with inheritance in mind, for example: - issue 32404 / issue 32403 - fromtimestamp not calling __new

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-04 Thread Paul Ganssle
Paul Ganssle added the comment: > This is not easy problem, ant it doesn't have right solution. Different > decisions were made for the result type of alternate constructors and > operators for different classes. It's certainly true that it occasionally makes sense to do something like this,

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not easy problem, ant it doesn't have right solution. Different decisions were made for the result type of alternate constructors and operators for different classes. The frombytes() method of an int subclass returns an int. As well arithmetic op

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-04 Thread Paul Ganssle
Paul Ganssle added the comment: This is another manifestation of issue 32417. The biggest complication, to me, is that adding a `timedelta` to a datetime always returns a `datetime.datetime` rather than the subclass that it was added to. I *think* most if not all people would consider this

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-02 Thread Prabakaran Kumaresshan
Prabakaran Kumaresshan added the comment: It's a side effect of a date arithmetic operation performed while setting timezone. while passing tz info to datetime invokes tz.fromutc() -> https://github.com/python/cpython/blob/3df85404d4bf420db3362eeae1345f2cad948a71/Lib/datetime.py#L1593 follo

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-11-30 Thread Adrien
Adrien added the comment: Actually, this also occurs while using "astimezone()" on a custom child class (I suppose this method is used by "fromtimestamp()"). -- ___ Python tracker __

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-11-30 Thread Adrien
New submission from Adrien : Hello. I created a class inheriting from "datetime.datetime". While creating a new instance using the classmethod "fromtimestamp" it seems to work, except if I provide a timezone object. In such case, the returned object is of base type datetime. This looks like