How do you copy a Dictionary object from C code?

Warren Postma embed at NOSPAM.geocities.com
Tue Jun 27 13:16:13 EDT 2000


"Warren Postma" <embed at NOSPAM.geocities.com> wrote in message
news:Ge565.9419$227.220401 at nnrp1.uunet.ca...
> Please Guido, add PyDict_Copy( dict ) to the API in the future!!!!
>
> This is an annoying oversight in the Dictionary's design.

Nope. I was wrong. I'm an idiot. I'm sorry.

I just realized that I shouldn't automatically assume the implementation is
actually that of dictobject.c, in other words another "sort of a dictionary
thing" would also work in place of a real dictobject.c object, but only if I
treating it with respect. It is some kind of Object, and it has an attribute
named "copy" which I can invoke. Much better.  Kudos to the Abstract and
Weird way that Guido's mind works.

Warren





More information about the Python-list mailing list