[Tutor] class attributes

Alan Gauld alan.gauld at freenet.co.uk
Wed Nov 16 23:38:35 CET 2005

> I have a class with attributes

Are they class attributes - shared by all instances of the class or are
they instance attributes - unique values in each instance?

>  I am now going back through my object list of that
> class

So you have a list of all the instances of the class and modifying values.
Since you do it on a per instance basis I assume that means the attributres
are instance attributes(ie created inside an init method)?

> assigning values to the attributes depending on another variable
> that will change and be the same names like the class attribute names.

So the names are names of attributes not names of classes?
In that case I think you need to use setattr()

I think...

Alan G
Author of the learn to program web tutor

More information about the Tutor mailing list