type = "instance" instead of "dict"

Fredrik Lundh fredrik at pythonware.com
Tue Feb 28 02:33:15 EST 2006


James Stroud wrote:

> Perhaps you did not know that you can inheret directly from dict, which
> is the same as {}. For instance:
>
> class Dict({}):
>    pass
>
> Is the same as
>
> class Dict(dict):
>    pass

it is ?

>>> class Dict({}):
...     pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Error when calling the metaclass bases
    dict expected at most 1 arguments, got 3

</F>






More information about the Python-list mailing list