On Fri, Dec 24, 2010 at 1:52 PM, kj <no.em...@please.post> wrote:
> Watch this:
>
>>>> class neodict(dict): pass
> ...
>>>> d = neodict()
>>>> type(d)
> <class '__main__.neodict'>
>>>> type(d.copy())
> <type 'dict'>
>
>
> Bug?  Feature?  Genius beyond the grasp of schlubs like me?
 copy, here, is a dict method. It will create a dict.
If you really need it, you could try this:

import copy
class neodict(dict):
    def copy(self):
        return copy.copy(self)

d = neodict()
print type(d)
dd = d.copy()
print type(dd)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to