On Feb 22, 10:10 am, Peter Otten <__pete...@web.de> wrote:
> Looks like invoking OrderedDict.__init__() is necessary:
>
> >>> from collections import OrderedDict
> >>> class X(OrderedDict):
>
> ... def __init__(self, stuff):
> ... super(X, self).__init__()
> ... for k, v
Bruce Eckel wrote:
> Notice that both classes are identical, except that one inherits from
> dict (and works) and the other inherits from OrderedDict and fails.
> Has anyone seen this before? Thanks.
>
> import collections
>
> class Y(dict):
> def __init__(self, stuff):
> for k, v in
Notice that both classes are identical, except that one inherits from
dict (and works) and the other inherits from OrderedDict and fails.
Has anyone seen this before? Thanks.
import collections
class Y(dict):
def __init__(self, stuff):
for k, v in stuff:
self[k] = v
# Thi