classification
Title: Overriding OrderedDict.__getitem__() doesn't work
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: alex, davipo
Priority: normal Keywords:

Created on 2013-09-09 21:50 by davipo, last changed 2013-09-09 22:16 by davipo. This issue is now closed.

Files
File name Uploaded Description Edit
OrderedDictTest.py davipo, 2013-09-09 21:50
Messages (3)
msg197404 - (view) Author: Davi Post (davipo) Date: 2013-09-09 21:50
class MyOrderedDict(OrderedDict):
   
    def __getitem__(self, key):
        OrderedDict.__getitem__(self, key)

After setting a key, getting it returns None. See attached.

Am I missing something?

Discovered this when trying to use the dict_type parameter of ConfigParser.RawConfigParser -- caused an AttributeError.

Possibly relevant to http://bugs.python.org/issue9534
msg197407 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2013-09-09 21:56
Your __getitem__ never returns the result of OrderedDict.__getitem__
msg197408 - (view) Author: Davi Post (davipo) Date: 2013-09-09 22:16
Oops. Thanks.  :-{

On Mon, Sep 9, 2013 at 4:56 PM, Alex Gaynor <report@bugs.python.org> wrote:

>
> Alex Gaynor added the comment:
>
> Your __getitem__ never returns the result of OrderedDict.__getitem__
>
> ----------
> nosy: +alex
> resolution:  -> invalid
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue18991>
> _______________________________________
>
History
Date User Action Args
2013-09-09 22:16:24daviposetmessages: + msg197408
2013-09-09 21:56:42alexsetstatus: open -> closed

nosy: + alex
messages: + msg197407

resolution: not a bug
2013-09-09 21:50:06davipocreate