Subclassing builtin types

Daniel Klein danielk at aracnet.com
Sun Mar 4 13:13:10 EST 2001


On Sun, 4 Mar 2001 12:41:55 -0500, "Steve Holden" <sholden at holdenweb.com>
wrote:

>> 1) Are wrapper classes for the builtin types a feasible (and pythonic)
>thing to
>> do?
>>
>Yes and yes: so feasible the library includes a UserList class which
>provides esxactly what you seem to want: it wraps a list inside a class so
>you can inherit from it!

Thanks Steve, you have just saved me a ton of work, something Python has a
habit of doing consistently. :-)

> Delegation is also a useful trick.

I'm not sure what you mean by this. Are there any simple examples I can look
at?

Dan



More information about the Python-list mailing list