Re: list as an instance attribute

2009-09-14 Thread Lie Ryan
Robin Becker wrote: Python is often put forward as a as a finger friendly language, but we have capitals encouraged for user class names and for some common values eg None, True, False these are required. And I'm glad it is, or else I'll get a finger-sore and an eye-sore -- http://mail.pyth

Re: list as an instance attribute

2009-09-14 Thread Miles Kaufmann
On Sep 14, 2009, at 1:55 AM, Robin Becker wrote: Bruno Desthuilliers wrote: pep08 : class names should be Capitalized. Also, if you're using Python 2.x, make it: class Primitive(object): #... ... I find it remarkable that the most primitive classes appear to break the pep08 convention

Re: list as an instance attribute

2009-09-14 Thread Robin Becker
Bruno Desthuilliers wrote: Daniel Santos a écrit : Here goes, I have a base class that is the following : class primitive: pep08 : class names should be Capitalized. Also, if you're using Python 2.x, make it: class Primitive(object): #... ... I find it remarkable that the most pr

Re: list as an instance attribute

2009-09-14 Thread Bruno Desthuilliers
Daniel Santos a écrit : Here goes, I have a base class that is the following : class primitive: pep08 : class names should be Capitalized. Also, if you're using Python 2.x, make it: class Primitive(object): #... def __init__(self): self.name = ""

Re: list as an instance attribute

2009-09-14 Thread r
On Sep 13, 7:34 pm, Daniel Santos wrote: > Here goes, > > I have a base class that is the following : > > class primitive: > >         def __init__(self): >                 self.name = "" >                 self.transforms = [] > >         def copyInternalState(self, sourceObj, copyName): >        

Re: list as an instance attribute

2009-09-14 Thread Daniel Santos
>> >>>         def copy(self, copyName) >>> >>>                 copy = self.copyInternalState(copyName)  # method defined >>> elsewhere >>> in derived class >>> >>>                 if self.transforms != [] >>>                         for transf in self.

Re: list as an instance attribute

2009-09-12 Thread Chris Rebert
ss >> >>                 if self.transforms != [] >>                         for transf in self.transforms >>                                 copy.transforms.append(transf.copy()) >> >> In short, what I want to is to have the transforms list as an instance >> attribute of the

Re: list as an instance attribute

2009-09-12 Thread André
copy()) > > In short, what I want to is to have the transforms list as an instance > attribute of the class. I will add objects to it. When I call the copy > method on the object the list is to be copied to the new object. > > Problem is that the python interpreter is complainin

list as an instance attribute

2009-09-12 Thread Daniel Luis dos Santos
if self.transforms != [] for transf in self.transforms copy.transforms.append(transf.copy()) In short, what I want to is to have the transforms list as an instance attribute of the class. I will add objects to it. When I call the copy