Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想__iter__在元组的子类中禁用。我这样做:
__iter__
def __iter__(self): raise TypeError("'%s' object is not iterable" % self.__class__.__name__)
但这似乎不是正确的方法。任何人都可以帮忙吗?