[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-13 Thread Olivier Gagnon
Olivier Gagnon added the comment: Yes I do have code that break because of this behaviour. I'm doing evolutionary algorithm using a framework called DEAP. This framework creates a type called individual at the runtime by subclassing a container and adding it a fitness attribute.

[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-12 Thread Olivier Gagnon
Olivier Gagnon added the comment: 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

[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-10 Thread Olivier Gagnon
Olivier Gagnon added the comment: The dictionary and the set do not give the freedom to add dynamic attributes to them. I agree that the Counter should have the same behaviour. However, this will raise the same bug when we inherit from a Counter object. >>> class mylist(list): pass .

[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-03 Thread Olivier Gagnon
New submission from Olivier Gagnon: The following code shows that the Counter is not deepcopied properly. The same code with an user defined class or a dict is copied with the "b" attribute. import collections import copy count = collections.Counter() count.b = 3 print(count.b)