This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lig
Recipients lig
Date 2015-10-05.02:03:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1444010587.49.0.504903152106.issue25315@psf.upfronthosting.co.za>
In-reply-to
Content
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>
History
Date User Action Args
2015-10-05 02:03:07ligsetrecipients: + lig
2015-10-05 02:03:07ligsetmessageid: <1444010587.49.0.504903152106.issue25315@psf.upfronthosting.co.za>
2015-10-05 02:03:07liglinkissue25315 messages
2015-10-05 02:03:06ligcreate