On Nov 20, 6:54 pm, r0g <[EMAIL PROTECTED]> wrote: > It would seem from this setattr function that the proper term for these > is 'attributes'. That for many years I have considered pretty much any > named thing that may vary a 'variable' might be at the root of the > problem here as it's a very un-specific term...
Exactly, refrain from using the term "variable", or "value" for that matter, in Python context as they are notorious for causing more trouble than they deserve.. > So I gather you are saying that the fragments of state within a class > are so distinct from ordinary common or garden variables that it is > incorrect to think of them, or describe them, as variables, much like > quarks should not really be regarded as distinct particles, and they > should only be thought of and described as 'attributes' to avoid confusion? > > Is this correct enough for me to avoid the aforementioned bug pile? No, a class can have attributes just like a instance can, and you can use setattr() to set an attribute for a class just like you do it for instances: class Foo(): bar = 1 gum = 2 >>> setattr(Foo, 'bar', 3) >>> Foo.bar 3 George -- http://mail.python.org/mailman/listinfo/python-list