On 24/07/18 12:02, David Mertz wrote:
Every use I've suggested for the magic proxy is similar to:

   NullCoalesce(cfg).user.profile.food

Yes, the class is magic. That much more so in the library I published last
night that utilizes wrapt.ObjectProxy. But it's also pretty explicit in
that an actual*word*  announces that funny stuff is going to happen on the
same line.

     Foo(cfg).user.profile.food

Is that explicit that funny stuff is going to happen on the same line? I wouldn't generally assume so, I'd just assume the coder created a throwaway object to get at an attribute. You have to know that "NullCoalesce" does magic before it is at all explicit that funny stuff will happen. Thinking about it, NullCoalesce() may be *less* explicit than ?. because at least that doesn't look like ordinary attribute reference.

I'm still of the opinion that both approaches are trying to solve a problem that's too niche to merit them, BTW.

--
Rhodri James *-* Kynesim Ltd
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to