On 18.02.21 05:43, Chris Angelico wrote:
On Thu, Feb 18, 2021 at 1:59 PM Ben Rudiak-Gould
wrote: It seems to me that all you'd have to do is add a line or two to the add_dict logic in type_new so that instances of object get a dict. Then instances of object would get a dict, and nothing else would change.
That's actually a pretty neat idea. :-)
What's so hard about using a different type?
Didnt we already discuss it somewhere else? Many programmers and computer scientists think in "objects", "object-oriented programming" etc.
Especially since the vanilla object repr is basically useless, but SimpleNamespace can tell you what it's carrying.
True but it seems this have never been an issue with "lambda:0".
Orthogonal point: SimpleNamespace could easily be made JSON-serializable (as a dict), if that would be of value.
Sounds great. :-) Best, Sven