How do you control _all_ items added to a list?
Xif
xifxif at gmail.com
Mon Feb 28 08:57:06 EST 2005
Hi
I want to have control over all items added to a list.
The first attempt was to subclass list and override its .append()
method.
Problem is, there are plenty of other ways the list can have items
added to it - e.g. extend, insert - and theyr'e not at all affected by
the changes I made to append.
Is there some "base" item-adding method that all other item-adding
methods use, so I can override it and have the changes affect all
item-adding functions?
Thanks,
Xif
More information about the Python-list
mailing list