Confounded by Python objects
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Thu Jul 24 06:03:26 EDT 2008
In message
<33c9309a-9679-41f6-a777-2874aad1903a at z66g2000hsc.googlegroups.com>,
boblatest at googlemail.com wrote:
> class Channel:
> name = ''
> sample = []
These are class variables, not instance variables. Take them out, and ...
> def __init__(self, name):
> self.name = name
... add this line to the above function
self.sample = []
More information about the Python-list
mailing list