def _as_multiset(cls, other):
if isinstance(other, BaseMultiset):
return other
if isinstance(other, _all_basic_types):
pass
elif not isinstance(other, Iterable):
raise TypeError("'%s' object is not iterable" % type(other)) # pragma: no cover
return cls(other)
评论列表
文章目录