You're right. I agree on that it's important to use proper words.
Thanks for the correction.
Best regards,
Javier
2009/5/29 Steven D'Aprano :
> On Fri, 29 May 2009 12:04:53 +0200, Javier Collado wrote:
>
>> Hello,
>>
>> First thing is a class variable (one for every instance) and second one
>
Kless wrote:
I usually use a class to access to global variables. So, which would
be the correct way to set them --since the following classes--:
class Foo:
var = 'lala'
class Bar:
def __init__(self):
self.var = 'lele'
Or is it the same?
Kless wrote:
I usually use a class to access to global variables. So, which would
be the correct way to set them --since the following classes--:
class Foo:
var = 'lala'
class Bar:
def __init__(self):
self.var = 'lele'
Or is it the same?
On Fri, 29 May 2009 12:04:53 +0200, Javier Collado wrote:
> Hello,
>
> First thing is a class variable (one for every instance) and second one
> an instance variable (one per instance).
One of these things don't belong:
A string variable is a variable holding a string.
A float variable is a var
Hello,
First thing is a class variable (one for every instance) and second
one an instance variable (one per instance).
For further information, please take a look at:
http://diveintopython.org/object_oriented_framework/class_attributes.html
Best regards,
Javier
2009/5/29 Kless :
> I usually
> Kless (K) wrote:
>K> I usually use a class to access to global variables. So, which would
>K> be the correct way to set them --since the following classes--:
>K>
>K> class Foo:
>K>var = 'lala'
>K> class Bar:
>K>def __init__(self):
>K> self.var = 'lele'
>
I usually use a class to access to global variables. So, which would
be the correct way to set them --since the following classes--:
class Foo:
var = 'lala'
class Bar:
def __init__(self):
self.var = 'lele'
Or is it the same?
--
http://mail.p