Message82692
To give an example of what the test could check:
>>> class C(object):
... def __init__(self):
... self.some_long_attribute_name = 5
...
>>> c = C()
>>> c.__dict__
{'some_long_attribute_name': 5}
>>> sorted(map(id, c.__dict__))
[140371243499696]
>>> import pickle
>>> d = pickle.loads(pickle.dumps(c, -1))
>>> d
<__main__.C object at 0x7faaba1b0390>
>>> d.__dict__
{'some_long_attribute_name': 5}
>>> sorted(map(id, d.__dict__))
[140371243501232]
The `sorted(map(id, d.__dict__))` should have been the same before and
after pickling. |
|
Date |
User |
Action |
Args |
2009-02-25 02:11:38 | pitrou | set | recipients:
+ pitrou, collinwinter, jcea, ggenellina, alexandre.vassalotti, jyasskin, jakemcguire |
2009-02-25 02:11:37 | pitrou | set | messageid: <1235527897.82.0.442250454679.issue5084@psf.upfronthosting.co.za> |
2009-02-25 02:11:36 | pitrou | link | issue5084 messages |
2009-02-25 02:11:36 | pitrou | create | |
|