After `x = x.y()`, why did `x` become `None` instead of being modified (possibly causing “AttributeError: ‘NoneType’ object has no attribute”)?
Summary The method in question returns the special value None, which is the unique instance of the NoneType type. It updates the object as a side effect, and does not return that object. Since x.y() returns None, x = x.y() causes x to become None, and x.y().z() fails because None does not have the specified … Read more