<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Tue, Jul 24, 2018, 7:38 AM Rhodri James <<a href="mailto:rhodri@kynesim.co.uk" target="_blank" rel="noreferrer">rhodri@kynesim.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 24/07/18 12:02, David Mertz wrote:<br>
> Every use I've suggested for the magic proxy is similar to:<br>
> <br>
>    NullCoalesce(cfg).user.profile.food<br>
> <br>
> Yes, the class is magic. That much more so in the library I published last<br>
> night that utilizes wrapt.ObjectProxy. But it's also pretty explicit in<br>
> that an actual*word*  announces that funny stuff is going to happen on the<br>
> same line.<br>
<br>
      Foo(cfg).user.profile.food<br>
<br>
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.  </blockquote></div></div><div dir="auto"><br></div><div dir="auto">Foo isn't a very indicative name. NoneCoalesce (or NullCoalesce, or GreedyAccess) is. But if I had any doubt, I could read the docstring for Foo to find out how magical it was, and in what way. I definitely know *something* is happening by creating that new instance in the line.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm still of the opinion that both approaches are trying to solve a <br>
problem that's too niche to merit them, BTW.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That doesn't make sense to me. You think my little library shouldn't be allowed on PyPI? I don't force the couple classes on anyone, but if they happen to help someone (or PyMaybe, or some other library, does) they don't change anything about Python itself. Syntax is a very different matter.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>