Message146175
| Author |
genij.math |
| Recipients |
Marian.Ganisin, flox, genij.math |
| Date |
2011年10月22日.17:29:13 |
| SpamBayes Score |
2.3736846e-11 |
| Marked as misclassified |
No |
| Message-id |
<1319304554.62.0.143866395789.issue10131@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
You can create object copy using both copy and pickle modules.
I assume that identical results should be produced.
pickle handles minidom.Document correctly, however copy does not.
Even if patch to NodeList will be applied, copy or pickle modules need to be adjusted to produce identical results.
From this view point copy module needs to be adjusted.
Here is the test code:
import copy, pickle
from xml.dom.minidom import NodeList
obj = NodeList()
obj.append('a')
obj2 = copy.deepcopy(obj)
print(obj2)
obj2 = pickle.loads(pickle.dumps(obj))
print(obj2)
Output (python 2.7-3.2):
['a', 'a']
['a'] |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年10月22日 17:29:14 | genij.math | set | recipients:
+ genij.math, flox, Marian.Ganisin |
| 2011年10月22日 17:29:14 | genij.math | set | messageid: <1319304554.62.0.143866395789.issue10131@psf.upfronthosting.co.za> |
| 2011年10月22日 17:29:14 | genij.math | link | issue10131 messages |
| 2011年10月22日 17:29:13 | genij.math | create |
|