--- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > One random idea is to for Python 3000, make the > equivalent of > __slots__ the default, *but* instead gather > the set of attributes from all member variables set > in __init__.
Are you suggesting to do this at startup time or runtime? The pitfall here is that to reduce code duplication, you might initialize certain variables in a method called by __init__, because your object might want to return to its initial state. An example might be an object that flipflops between waiting for headers and waiting for payloads. You might have code like this: class MessageReader: def __init__(self, incoming_port): self.incoming_port = incoming_port self.start_waiting_for_headers() def start_waiting_for_headers(self): self.waiting_for_headers = '' self.header = '' self.payload = '' def handle_payload(self): self.do_something_with(self.payload) self.start_waiting_for_headers() # ... ____________________________________________________________________________________ Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/ -- http://mail.python.org/mailman/listinfo/python-list