Calling __new__ when making a subclass of tuple [duplicate]
问题 This question already has answers here : Why is __init__() always called after __new__()? (18 answers) Closed 4 years ago . In Python, when subclassing tuple, the __new__ function is called with self as an argument. For example, here is a paraphrased version of PySpark's Row class: class Row(tuple): def __new__(self, args): return tuple.__new__(self, args) But help(tuple) shows no self argument to __new__ : __new__(*args, **kwargs) from builtins.type Create and return a new object. See help