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 eltoder
Recipients Arfrever, barry, bru, eli.bendersky, eltoder, ethan.furman, facundobatista, iyogeshjoshi, juggernaut, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, skrah, vstinner
Date 2016-05-11.18:53:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1462992807.78.0.0857920263338.issue23640@psf.upfronthosting.co.za>
In-reply-to
Content
There's a similar issue with replace() methods on date/time/datetime classes. They create instances of derived types without calling derived __new__/__init__, thus potentially leaving those uninitialized.

>>> from datetime import date
>>> class D(date):
...   def __init__(self, y, m, d):
...     self.y = y
>>> D(2016,1,1).y
2016
>>> D(2016,1,1).replace(2015).y
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'D' object has no attribute 'y'
History
Date User Action Args
2016-05-11 18:53:27eltodersetrecipients: + eltoder, barry, rhettinger, facundobatista, mark.dickinson, pitrou, vstinner, Arfrever, eli.bendersky, skrah, ethan.furman, serhiy.storchaka, bru, juggernaut, iyogeshjoshi
2016-05-11 18:53:27eltodersetmessageid: <1462992807.78.0.0857920263338.issue23640@psf.upfronthosting.co.za>
2016-05-11 18:53:27eltoderlinkissue23640 messages
2016-05-11 18:53:27eltodercreate