I want to disable __iter__
in subclass of tuple. I do it like this:
def __iter__(self):
raise TypeError("'%s' object is not iterable" % self.__class__.__name__)
But it seems not the right way. Anyone can help?
I want to disable __iter__
in subclass of tuple. I do it like this:
def __iter__(self):
raise TypeError("'%s' object is not iterable" % self.__class__.__name__)
But it seems not the right way. Anyone can help?