In my case, I want to define a custom class (called WordTuple) which is a subclass of the tuple class. The elements of this custom tuple must all be of another custom class(called Word).
I know that this question (How to make an iterable class in Python in which only a specific type is allowed to be the element?) is similar, but the answer is not what I am looking for, nor it is very clear to me.
class Word(str):
pass
class WordTuple(tuple):
# Here whatever is necessary for the elements of this particular tuple
# to be all members of the class 'Word'
pass