A.

B.

I really like this object, I like how to iteratively solve it for all dict keys and values and I think it would be a great addition to a dict-like interface.

The “object A.B.I is not subscriptable” warning can be silenced by decorating the dict object with a _deco method. Now you can do the following: dict.__dict__[key] = value If dict.__dict__ is defined as: dict = {‘key’ : ‘value’} ‘_deco’ returns: dict[key] = value dict.

A.B.I has a bunch of useful methods which you can add to your own dicts. You can search its methods too, e.g. dict.find(_iter in dict, keys = x) If _iter is passed as a value the function return the dict entry for those keys.In our example dict the _deco method must be in that order if it is there then it must be first in the return of _dict.

I agree, it is cool, I’m using its methods for my own objects. The code is also pretty neat. As for dict keys and values, there have been many suggestions, I have even added a _find_iter method to it that I call _deco’s, as well as a dict.count, as described below. Also, if you are interested in a full list of my dict-likes, see my GitHub (Github) repo.

LEAVE A REPLY

Please enter your comment!
Please enter your name here