I agree. It needs cleanup. Fox example:

>>> class A:
...     z=3
...     def f(self): return self.z
...
>>> a=A()
>>> print a.f()
3
>>> a.z=5
>>> print a.f()
5
>>> b=A()
>>> print b.f()
3
>>> print a.f()
5

So z is not quite equivalent to a static member variable in C++.

On May 28, 11:15 pm, Doug Warren <[email protected]> wrote:
> I'm not sure if the group is the correct place to ask questions about the
> wiki or not, so if it's not the right place please let me know what is...
> I've used python a bit in the past but needed a refresher so I started going
> through the tutorial in the web2py book and ran across the following:
>
> http://web2py.com/book/default/section/2/11
>
> At the top of the page it states:
> *
> Attributes are generally associated with the instance, not the class (except
> when declared as "class attributes", which is the same as "static member
> variables" in C++/Java). *
>
> further down the page however it states:
>
> *All variables are local variables of the method except variables declared
> outside methods. For example, z is a class variable, equivalent to a C++
> static member variable that holds the same value for all instances of the
> class. *
>
> So is there a difference between an attribute and a variable?  Is z a class
> variable? a class attribute?  both?  Seems that the page needs to be cleaned
> up to use consistent wording, unless there is an actual difference between
> the two.
>
> Thanks,
> -Doug

Reply via email to