Message192936
| Author |
Olivier.Gagnon |
| Recipients |
Olivier.Gagnon, eric.snow, madison.may, rhettinger, serhiy.storchaka, vajrasky |
| Date |
2013年07月12日.12:29:28 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1373632168.22.0.554052834365.issue18352@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I can understand that the current behaviour can be correct in regard with the added attributes of the object. However, should I open a new issue for the following inheritance behaviour which the reduce function affects also.
class myCounter(Counter):
def __init__(self, bar, *args):
self.foo = bar
super().__init__(*args)
class myDict(dict):
def __init__(self, bar, *args):
self.foo = bar
super().__init__(*args)
c = myCounter("bar")
l = myDict("bar")
print(c.foo) # prints bar
print(l.foo) # prints bar
cc = copy.copy(c)
ll = copy.copy(l)
print(cc.foo) # prints {}
print(ll.foo) # prints bar |
|