2 ms·
Why would it need to recurse? The method probably just returns a copy of the instance's __dict__. Maybe updating it with the __slots__ and their values.
by xapata 10y ago
Why would it need to recurse? The method probably just returns a copy of the instance's __dict__. Maybe updating it with the __slots__ and their values.
- rspeer 10y agoIt would need to recurse because you want something you can encode in JSON, not a dictionary containing a list containing miscellaneous instances. We have an example there of an 'attrs' instance, containing a list containing 'attrs' instances, and all of the instances turn into dictionaries.