Re: Help understanding an Object Oriented Program example

2012-10-29 Thread Ulrich Eckhardt
Am 29.10.2012 00:30, schrieb goldtech: class Contact: all_contacts = [] def __init__(self, name, email): self.name = name self.email = email Contact.all_contacts.append(self) Okay, a class that automatically registers all instances in a central list. OK,

Re: Help understanding an Object Oriented Program example

2012-10-28 Thread Chris Angelico
On Mon, Oct 29, 2012 at 10:30 AM, goldtech wrote: > Hi, > > Trying to learn Python OOP. An example from a book, may not be > formated after sending post but: > > class Contact: > all_contacts = [] > def __init__(self, name, email): > self.name = name > self.email = email >

Re: Help understanding an Object Oriented Program example

2012-10-28 Thread Chris Rebert
On Sun, Oct 28, 2012 at 4:30 PM, goldtech wrote: > Hi, > > Trying to learn Python OOP. An example from a book, may not be > formated after sending post but: > > class Contact: > all_contacts = [] > def __init__(self, name, email): > self.name = name > self.email = email >

Help understanding an Object Oriented Program example

2012-10-28 Thread goldtech
Hi, Trying to learn Python OOP. An example from a book, may not be formated after sending post but: class Contact: all_contacts = [] def __init__(self, name, email): self.name = name self.email = email Contact.all_contacts.append(self) OK, no I do this: >>> c = C