Message252296
Consider this code in Python 3.5.0:
Python 3.5.0 (default, Sep 26 2015, 14:59:25)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> class MyDict(OrderedDict):
... def __setitem__(self, *args, **kwargs):
... print(self._OrderedDict__root)
... OrderedDict.__setitem__(self, *args, **kwargs)
...
>>> md = MyDict({'a': 1})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in __setitem__
AttributeError: 'MyDict' object has no attribute '_OrderedDict__root'
However in Python 3.4:
Python 3.4.2 (default, Jul 9 2015, 17:24:30)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> class MyDict(OrderedDict):
... def __setitem__(self, *args, **kwargs):
... print(self._OrderedDict__root)
... OrderedDict.__setitem__(self, *args, **kwargs)
...
>>> md = MyDict({'a': 1})
<collections._Link object at 0x7f0398a79b88> |
|
Date |
User |
Action |
Args |
2015-10-05 02:03:07 | lig | set | recipients:
+ lig |
2015-10-05 02:03:07 | lig | set | messageid: <1444010587.49.0.504903152106.issue25315@psf.upfronthosting.co.za> |
2015-10-05 02:03:07 | lig | link | issue25315 messages |
2015-10-05 02:03:06 | lig | create | |
|