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


Python types.append方法代碼示例

本文整理匯總了Python中types.append方法的典型用法代碼示例。如果您正苦於以下問題:Python types.append方法的具體用法?Python types.append怎麽用?Python types.append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在types的用法示例。


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

示例1: force_flatten

# 需要導入模塊: import types [as 別名]
# 或者: from types import append [as 別名]
def force_flatten(self):
        # force the struct or union to have a declaration that lists
        # directly all fields returned by enumfields(), flattening
        # nested anonymous structs/unions.
        names = []
        types = []
        bitsizes = []
        fldquals = []
        for name, type, bitsize, quals in self.enumfields():
            names.append(name)
            types.append(type)
            bitsizes.append(bitsize)
            fldquals.append(quals)
        self.fldnames = tuple(names)
        self.fldtypes = tuple(types)
        self.fldbitsize = tuple(bitsizes)
        self.fldquals = tuple(fldquals) 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:19,代碼來源:model.py

示例2: register_plugin

# 需要導入模塊: import types [as 別名]
# 或者: from types import append [as 別名]
def register_plugin(superclass, obj):
    """Register an individual `obj` of type `superclass`

    Arguments:
        superclass (type): Superclass of plug-in
        obj (object): Subclass of `superclass`

    """

    if superclass not in _registered_plugins:
        _registered_plugins[superclass] = list()

    if obj not in _registered_plugins[superclass]:
        _registered_plugins[superclass].append(obj) 
開發者ID:getavalon,項目名稱:core,代碼行數:16,代碼來源:pipeline.py

示例3: register_plugin_path

# 需要導入模塊: import types [as 別名]
# 或者: from types import append [as 別名]
def register_plugin_path(superclass, path):
    """Register a directory of one or more plug-ins

    Arguments:
        superclass (type): Superclass of plug-ins to look for during discovery
        path (str): Absolute path to directory in which to discover plug-ins

    """

    if superclass not in _registered_plugin_paths:
        _registered_plugin_paths[superclass] = list()

    path = os.path.normpath(path)
    if path not in _registered_plugin_paths[superclass]:
        _registered_plugin_paths[superclass].append(path) 
開發者ID:getavalon,項目名稱:core,代碼行數:17,代碼來源:pipeline.py

示例4: __init__

# 需要導入模塊: import types [as 別名]
# 或者: from types import append [as 別名]
def __init__(self, args, result, ellipsis, abi=None):
        self.args = args
        self.result = result
        self.ellipsis = ellipsis
        self.abi = abi
        #
        reprargs = [arg._get_c_name() for arg in self.args]
        if self.ellipsis:
            reprargs.append('...')
        reprargs = reprargs or ['void']
        replace_with = self._base_pattern % (', '.join(reprargs),)
        if abi is not None:
            replace_with = replace_with[:1] + abi + ' ' + replace_with[1:]
        self.c_name_with_marker = (
            self.result.c_name_with_marker.replace('&', replace_with)) 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:17,代碼來源:model.py

示例5: build_backend_type

# 需要導入模塊: import types [as 別名]
# 或者: from types import append [as 別名]
def build_backend_type(self, ffi, finishlist):
        result = self.result.get_cached_btype(ffi, finishlist)
        args = []
        for tp in self.args:
            args.append(tp.get_cached_btype(ffi, finishlist))
        abi_args = ()
        if self.abi == "__stdcall":
            if not self.ellipsis:    # __stdcall ignored for variadic funcs
                try:
                    abi_args = (ffi._backend.FFI_STDCALL,)
                except AttributeError:
                    pass
        return global_cache(self, ffi, 'new_function_type',
                            tuple(args), result, self.ellipsis, *abi_args) 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:16,代碼來源:model.py


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