def __init__(self, moduleName, defName, linkedType, returnTypes, handler=None, constraints=None, forward=True): ''' Create a new FunctionDefinition instance @param moduleName: definition owner module's name @type moduleName: string @param defName: function sign @type defName: string @param linkedType: an implementation object instance @type linkedType: L{Function} @param returnTypes: a tuple of return types classes @type returnTypes: tuple @param handler: method called on function called execution @type handler: method @param constraints: a list of function sign constraints @type constraints: list of L{FunctionConstraint} @param forward: definition could be redefined? @type forward: boolean ''' RestrictedDefinition.__init__(self, moduleName, defName, "deffunction", linkedType) self._handler = handler '''method called on function execution''' self._returnTypes = returnTypes if isinstance(returnTypes, tuple) else (returnTypes,) '''tuple of return types''' self._constraints = constraints if isinstance(constraints, list) else [] '''function call params constraints''' self._forward = bool(forward) '''flag: function could be redefined?'''
def __init__(self, moduleName, defName, linkedType): ''' Create a new definition from params @param moduleName: owner module's name @type moduleName: string @param defName: global def name @type defName: string @param linkedType: a types.GlobalVariable object linked to this definition @type linkedType: L{GlobalVariable} ''' RestrictedDefinition.__init__(self, moduleName, defName, "defglobal", linkedType)
def __init__(self, moduleName, defName, linkedType, slots=None): ''' Create a new definition from params @param moduleName: the owner module's name @type moduleName: string @param defName: the template name @type defName: string @param linkedType: the DefTemplateConstruct linked to this! @type linkedType: L{DefTemplateConstruct} @param slots: a list of slot definitions @type slots: list of L{SlotDefinition} ''' RestrictedDefinition.__init__(self, moduleName, defName, "deftemplate", linkedType) self._slots = {} if slots is None else slots
def __init__(self, moduleName, defName, linkedType, returnTypes, handler=None, constraints=None, forward=True): ''' Create a new FunctionDefinition instance @param moduleName: definition owner module's name @type moduleName: string @param defName: function sign @type defName: string @param linkedType: an implementation object instance @type linkedType: L{Function} @param returnTypes: a tuple of return types classes @type returnTypes: tuple @param handler: method called on function called execution @type handler: method @param constraints: a list of function sign constraints @type constraints: list of L{FunctionConstraint} @param forward: definition could be redefined? @type forward: boolean ''' RestrictedDefinition.__init__(self, moduleName, defName, "deffunction", linkedType) self._handler = handler '''method called on function execution''' self._returnTypes = returnTypes if isinstance( returnTypes, tuple) else (returnTypes, ) '''tuple of return types''' self._constraints = constraints if isinstance(constraints, list) else [] '''function call params constraints''' self._forward = bool(forward) '''flag: function could be redefined?'''