def __getattr__(self_, attr):
        """
        Extends attribute access to parameter objects.
        """
        cls = self_.__dict__.get('cls')
        if cls is None: # Class not initialized
            raise AttributeError

        try:
            params = list(getattr(cls, '_%s__params' % cls.__name__))
        except AttributeError:
            params = [n for class_ in classlist(cls) for n, v in class_.__dict__.items()
                      if isinstance(v, Parameter)]

        if attr in params:
            return self_.__getitem__(attr)
        elif self_.self is None:
            raise AttributeError("type object '%s.param' has no attribute %r" %
                                 (self_.cls.__name__, attr))
        else:
            raise AttributeError("'%s.param' object has no attribute %r" %
                                 (self_.cls.__name__, attr))
def __getattr__ ( self_ , attr ) : cls = self_ . __dict__ . get ( 'cls' ) if cls is None : raise AttributeError try : params = list ( getattr ( cls , '_%s__params' % cls . __name__ ) ) except AttributeError : params = [ n for class_ in classlist ( cls ) for n , v in class_ . __dict__ . items ( ) if isinstance ( v , Parameter ) ] if attr in params : return self_ . __getitem__ ( attr ) elif self_ . self is None : raise AttributeError ( "type object '%s.param' has no attribute %r" % ( self_ . cls . __name__ , attr ) ) else : raise AttributeError ( "'%s.param' object has no attribute %r" % ( self_ . cls . __name__ , attr ) )
Extends attribute access to parameter objects.