本文整理汇总了Python中TypeSlots.Signature.function_type方法的典型用法代码示例。如果您正苦于以下问题:Python Signature.function_type方法的具体用法?Python Signature.function_type怎么用?Python Signature.function_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeSlots.Signature
的用法示例。
在下文中一共展示了Signature.function_type方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: declare_in_scope
# 需要导入模块: from TypeSlots import Signature [as 别名]
# 或者: from TypeSlots.Signature import function_type [as 别名]
def declare_in_scope(self, scope):
func_type, sig = self.func_type, self.sig
if func_type is None:
if sig is None:
sig = Signature(self.args, self.ret_type)
func_type = sig.function_type()
scope.declare_builtin_cfunction(self.py_name, func_type, self.cname, self.py_equiv, self.utility_code)
示例2: init_builtin_types
# 需要导入模块: from TypeSlots import Signature [as 别名]
# 或者: from TypeSlots.Signature import function_type [as 别名]
def init_builtin_types():
for name, cname, funcs in builtin_types_table:
utility = builtin_utility_code.get(name)
the_type = builtin_scope.declare_builtin_type(name, cname, utility)
for name, args, ret, cname in funcs:
sig = Signature(args, ret)
the_type.scope.declare_cfunction(name, sig.function_type(), None, cname)
示例3: declare_in_type
# 需要导入模块: from TypeSlots import Signature [as 别名]
# 或者: from TypeSlots.Signature import function_type [as 别名]
def declare_in_type(self, self_type):
method_type, sig = self.func_type, self.sig
if method_type is None:
if sig is None:
sig = Signature(self.args, self.ret_type)
# override 'self' type (first argument)
self_arg = PyrexTypes.CFuncTypeArg("", self_type, None)
self_arg.not_none = True
method_type = sig.function_type(self_arg)
self_type.scope.declare_builtin_cfunction(self.py_name, method_type, self.cname, utility_code=self.utility_code)
示例4: build_func_type
# 需要导入模块: from TypeSlots import Signature [as 别名]
# 或者: from TypeSlots.Signature import function_type [as 别名]
def build_func_type(self, sig=None, self_arg=None):
if sig is None:
sig = Signature(self.args, self.ret_type)
sig.exception_check = False # not needed for the current builtins
func_type = sig.function_type(self_arg)
if self.is_strict_signature:
func_type.is_strict_signature = True
if self.builtin_return_type:
func_type.return_type = builtin_types[self.builtin_return_type]
return func_type
示例5: declare_builtin_method
# 需要导入模块: from TypeSlots import Signature [as 别名]
# 或者: from TypeSlots.Signature import function_type [as 别名]
def declare_builtin_method(self_type, name, args, ret, cname):
sig = Signature(args, ret)
meth_type = sig.function_type(self_type)
self_type.scope.declare_builtin_method(name, meth_type, cname)
示例6: declare_builtin_func
# 需要导入模块: from TypeSlots import Signature [as 别名]
# 或者: from TypeSlots.Signature import function_type [as 别名]
def declare_builtin_func(name, args, ret, cname, py_equiv = "*"):
sig = Signature(args, ret)
type = sig.function_type()
utility = builtin_utility_code.get(name)
builtin_scope.declare_builtin_cfunction(name, type, cname, py_equiv, utility)