subtype and super method. How to?

2008-07-16 Thread Prashant Saxena
import sys class Attribute(object):     """     Common attributes and methods for custom types     """     __slots__ = []          def __init__(self, name=None, type=None, range=(0,1)):     self.__name = name     self.__type = type     self.__range = range          #Read only attribute

Custom 'Float' class. Am I right here?

2008-07-16 Thread Prashant Saxena
import sys class Float(float): """ Custom float datatype with addtional attributes. """ def __new__(self, value=0.0, #default value name='', # string range=(0.0, 1.0) # tuple )