Allow the deafult constructor to accept an instance and return it unchainged
问题 I would like to allow my class constructor to accept an instance of this class and in that case to return this same instance instead of creating a new object. Like what tuple does: >>> t = (1, 2, 3) >>> tuple(t) is t True I imagine I need to override the __new__ method for this, and additionally take care of this special case in the __init__ method. Are there any recipes for this? I would have preferred to completely skip __init__ when the constructor is given a class instance that it is