本文整理汇总了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)
示例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)
示例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)
示例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))
示例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)