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 r.david.murray
Recipients Andrew.Lutomirski, belopolsky, eddygeek, eltoder, r.david.murray, serhiy.storchaka, yselivanov
Date 2016-05-15.16:43:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463330602.65.0.823860282258.issue20371@psf.upfronthosting.co.za>
In-reply-to
Content
Hmm.  The contract is actually that replace returns a *new* instance with the specified values changed.  So I think it would be adequate in this case to simply call the subclass constructor with the values that replace manages, and not worry about anything else.  There is actually no (current) contract to preserve any other values of the existing instance.

A subclass that wants to add other values that can be replaced will have to override replace, which should not be unexpected.
History
Date User Action Args
2016-05-15 16:43:22r.david.murraysetrecipients: + r.david.murray, belopolsky, eltoder, serhiy.storchaka, yselivanov, Andrew.Lutomirski, eddygeek
2016-05-15 16:43:22r.david.murraysetmessageid: <1463330602.65.0.823860282258.issue20371@psf.upfronthosting.co.za>
2016-05-15 16:43:22r.david.murraylinkissue20371 messages
2016-05-15 16:43:22r.david.murraycreate