def is_seq(s):
"""Return True if sequence is list or tuple or some facsimile.
Reject dictionary views, memoryview, bytearray, array.array etc.
"""
if isinstance(s, abc.Sequence) and not isinstance(s, (str, bytes)):
return True
return False
评论列表
文章目录