reinitialize an object with self.__init__(…)

The only thing special about __init__ is that it is called automatically when an instance is created. Other than that it is a normal method, and it is safe to use it to set your object back to its initial state.

That being said, just because it is safe doesn’t mean it is a good idea. Other people looking at your code might be confused by it, and it isn’t difficult to do everything in a reset method (that __init__ can even call) to be more explicit about how the method is being used.

Leave a Comment