473,322 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

subclassing list question

Hi,

I have a simple class that subclasses a list:

class CaListOfObj(list):
""" subclass of list """
def __init__(self, *args, **kwargs):
list.__init__(self, *args, **kwargs)

a= CaListOfObj([1,2,3])

Is it possible to have a method in the class that is called EVERY time
a is modified?

Thanks

May 21 '07 #1
0 933

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: GrelEns | last post by:
hello, i wonder if this possible to subclass a list or a tuple and add more attributes ? also does someone have a link to how well define is own iterable object ? what i was expecting was...
4
by: Jonas Koelker | last post by:
Hello there. I'm new to this list (/me welcomes himself). anyways, I'm having doubts about how to subclass properly. The big picture is that I want to handle permutations. As we all know, two...
3
by: Emiliano Molina | last post by:
Where can I find information on how to do this? Specifically I am concerned about something like: class NewList(list): def __init__(self): list.__init__(self) The above code does not allow...
2
by: BJörn Lindqvist | last post by:
A problem I have occured recently is that I want to subclass builtin types. Especially subclassing list is very troublesome to me. But I can't find the right syntax to use. Take for example this...
2
by: Uwe Mayer | last post by:
Hi, I want to subclass "list". The documentation states to prefer subclassing list instead of UserList. How to you clear the contents of a list subclass without creating a new object? Thanks...
12
by: Jane Austine | last post by:
Please see the following code: -------------------------------- class rev_wrap(object): def __init__(self,l): self.l=l def __getitem__(self,i): return self.l class rev_subclass(list): def...
3
by: alotcode | last post by:
Hello: What is 'interprocess subclassing'? To give more context, I am writing in reference to the following remark: With the advent of the Microsoft Win32 API, interprocess subclassing was...
5
by: Pieter Linden | last post by:
Hi, This question refers sort of to Rebecca Riordan's article on Access web about subclassing entities: http://www.mvps.org/access/tables/tbl0013.htm How practical is this? I am writing a...
0
by: manstey | last post by:
Hi, I have a simple class that subclasses list: class CaListOfObj(list): """ subclass of list """ def __init__(self, *args, **kwargs): list.__init__(self, *args, **kwargs) a =...
5
by: Mike Kent | last post by:
For Python 2.5 and new-style classes, what special method is called for mylist = seq and for del mylist (given that mylist is a list, and seq is some sequence)? I'm trying to subclass list, and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.