King wrote:

> My mistake...
> The correct __slots__ is like:
> __slots__ = ['_Attribute_name', '_Attribute_type', '_Attribute_range',
> 'label']
> 
> Could you please suggest an alternative or code improvement for the
> matter.

How about 

class AttributesMixin(object):
    """Warning: If you change name, type, or range of an existing object
       your computer will explode and you will have noone else to blame.
    """
    def __init__(self, name=None, type=None, range=None, label=None):
        self.name = name
        self.type = type
        self.range = range
        self.label = label

class Float(float, AttributesMixin): pass
class Int(int, AttributesMixin): pass

Now go and write something useful :-)

Peter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to