Message192239
| Author |
Olivier.Gagnon |
| Recipients |
Olivier.Gagnon |
| Date |
2013年07月03日.14:43:25 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1372862605.72.0.11799816843.issue18352@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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) # prints 3
count_copy = copy.deepcopy(count)
print(count_copy.b) # raise AttributeError: 'Counter' object has no attribute 'b' |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年07月03日 14:43:25 | Olivier.Gagnon | set | recipients:
+ Olivier.Gagnon |
| 2013年07月03日 14:43:25 | Olivier.Gagnon | set | messageid: <1372862605.72.0.11799816843.issue18352@psf.upfronthosting.co.za> |
| 2013年07月03日 14:43:25 | Olivier.Gagnon | link | issue18352 messages |
| 2013年07月03日 14:43:25 | Olivier.Gagnon | create |
|