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
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
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
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 = ""
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):
>
>>
>>> def copy(self, copyName)
>>>
>>> copy = self.copyInternalState(copyName) # method defined
>>> elsewhere
>>> in derived class
>>>
>>> if self.transforms != []
>>> for transf in self.
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
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
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