Some syntactic sugar proposals

Chris Rebert clp2 at
Mon Nov 15 07:48:04 CET 2010

On Sun, Nov 14, 2010 at 10:39 PM, Dmitry Groshev <lambdadmitry at> wrote:
> Here are some proposals. They are quite useful at my opinion and I'm
> interested for suggestions. It's all about some common patterns.
> Second, I saw a lot of questions about using dot notation for a
> "object-like" dictionaries and a lot of solutions like this:
>    class dotdict(dict):
>        def __getattr__(self, attr):
>            return self.get(attr, None)
>        __setattr__= dict.__setitem__
>        __delattr__= dict.__delitem__
> why there isn't something like this in a standart library?

There is:

The "bunch" recipe is also fairly well-known; I suppose one could
argue whether it's std-lib-worthy:


More information about the Python-list mailing list