On 09Feb2024 18:56, Left Right <olegsivo...@gmail.com> wrote:
But, more to the point: extending collections.abc.Mapping may or may not be possible in OP's case.
We don't yet know if that's what the OP had in mind yet, anyway.
Also, if you are doing this through inheritance, this seems really convoluted: why not just inherit from dict? -- less methods to implement, less stuff to import etc.
There's a rule of thumb that we _tend_ not to subclass the builtins; it certainly has its pitfalls to do with object creation/initialisation. That said, I have some classes which subclass dict, int, str and namedtuple.
Cheers, Cameron Simpson <c...@cskk.id.au> -- https://mail.python.org/mailman/listinfo/python-list