本文整理汇总了Python中mx.Tools.issequence方法的典型用法代码示例。如果您正苦于以下问题:Python Tools.issequence方法的具体用法?Python Tools.issequence怎么用?Python Tools.issequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mx.Tools
的用法示例。
在下文中一共展示了Tools.issequence方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_recursive
# 需要导入模块: from mx import Tools [as 别名]
# 或者: from mx.Tools import issequence [as 别名]
def print_recursive(obj,file=_sys.stdout,indent='',levels=1,
nonrecursive=(),filter=None):
# Filter out nonrecursive types and objects
try:
if type(obj) in nonrecursive or \
obj in nonrecursive:
return
except:
# Error during compares result in the object not being
# printed
return
# Print the object depending on its interface
if hasattr(obj,'__dict__') and \
obj.__dict__ is not None:
print_dict(obj.__dict__,file,indent,levels,
nonrecursive=nonrecursive, filter=filter)
elif hasattr(obj,'items'):
print_dict(obj,file,indent,levels,1,
nonrecursive=nonrecursive, filter=filter)
elif Tools.issequence(obj) and not is_string(obj):
print_sequence(obj,file,indent,levels,
nonrecursive=nonrecursive)
elif hasattr(obj,'__members__'):
d = {}
for attr in obj.__members__:
d[attr] = getattr(obj,attr)
print_dict(d, file, indent, levels,
nonrecursive=nonrecursive, filter=filter)