當前位置: 首頁>>代碼示例>>Python>>正文


Python TypeSlots.Signature類代碼示例

本文整理匯總了Python中TypeSlots.Signature的典型用法代碼示例。如果您正苦於以下問題:Python Signature類的具體用法?Python Signature怎麽用?Python Signature使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Signature類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: declare_in_scope

 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)
開發者ID:jpeel,項目名稱:cython,代碼行數:7,代碼來源:Builtin.py

示例2: init_builtin_types

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)
開發者ID:enyst,項目名稱:plexnet,代碼行數:7,代碼來源:Builtin.py

示例3: declare_in_type

 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)
開發者ID:jpeel,項目名稱:cython,代碼行數:10,代碼來源:Builtin.py

示例4: build_func_type

 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
開發者ID:yishenggudou,項目名稱:cython,代碼行數:10,代碼來源:Builtin.py

示例5: declare_builtin_method

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)
開發者ID:Distrotech,項目名稱:Pyrex,代碼行數:4,代碼來源:Builtin.py

示例6: declare_builtin_func

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)
開發者ID:Distrotech,項目名稱:Pyrex,代碼行數:5,代碼來源:Builtin.py


注:本文中的TypeSlots.Signature類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。