Since Py3.11 the methods names __setstate__ and __getstate__ conflict with the method names added to the object class. Thus rename them to 'loads' and 'dumps'