R. David Murray added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20371>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to