Re: Global variables from a class

2009-05-29 Thread Javier Collado
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 >

Re: Global variables from a class

2009-05-29 Thread Dave Angel
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?

Re: Global variables from a class

2009-05-29 Thread Jean-Michel Pichavant
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?

Re: Global variables from a class

2009-05-29 Thread 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 > 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

Re: Global variables from a class

2009-05-29 Thread Javier Collado
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

Re: Global variables from a class

2009-05-29 Thread Piet van Oostrum
> 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' >

Global variables from a class

2009-05-29 Thread Kless
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