extending the built in dictionary type
Aahz Maruch
aahz at panix.com
Mon Mar 26 20:36:45 EST 2001
In article <BXz8sKATYwu6Ewg9 at jessikat.fsnet.co.uk>,
Robin Becker <robin at jessikat.fsnet.co.uk> wrote:
>
>perhaps I didn't make myself clear. I will use UserDict for a python
>version, but if I want to accelerate to C I find fundamental problems in
>getting useful access to the code of say dictobject; in particular
>there's no obvious way to extend/modify in a small way; eg have a dict
>with just one more method. I either have to just copy that code
>wholesale or do rather silly things like changing my object's type
>before and after the operation.
Why not simply have your object contain a dict as one of its members and
delegate the base operations to the Python dict?
--
--- Aahz <*> (Copyright 2001 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het Pythonista http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
"Boost the stock market -- fire someone"
More information about the Python-list
mailing list