Checking for __iter__ works on sequence types, but it would fail on e.g. strings in Python 2. · Another general pythonic approach is to assume an iterable, then ...
確定! 回上一頁