<div dir="ltr">On Fri, Dec 1, 2017 at 6:16 AM, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> I genuinely don't think these kinds of operators are all that useful<br>
> outside the specific domain of working with semi-structured<br>
> hierarchical data stored in graph databases and document stores like<br>
> MongoDB, ElasticSearch, and PostgreSQL JSONB columns, or else piping<br>
> data between such stores and JSON consuming clients.<br>
<br>
</span>In that case, surely there are 3rd party libraries that help with<br>
extracting such data from raw objects?</blockquote><div><br></div><div>Sure -- it's handled by validation libraries like Colander, for instance:<br><br><a href="https://docs.pylonsproject.org/projects/colander/en/latest/">https://docs.pylonsproject.org/projects/colander/en/latest/</a><br><br></div><div>And I'd be shocked if there weren't similar functionality built in to PyMongo and such.<br><br></div><div>Which makes a lot of sense -- if you want to enforce any kind of schema, you need to specify which fields are optional, and handle those cases.<br><br></div><div>So this is perhaps largely about making it easier to write such libraries.<br><br></div><div>Though the other really common use case is None default parameters:<br><br></div><div>def fun(self, par1, par2, par3=None):<br></div><div>    if par3 is None:<br></div><div>        self.par3 = something_mutable <br><br></div><div>is a really common idiom -- though not all the verbose.<br><br></div><div>-CHB<br clear="all"></div></div><br>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>