<div dir="auto"><div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jan 26, 2019, 6:30 AM Anders Hovmöller <<a href="mailto:boxed@killingar.net">boxed@killingar.net</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> I don't see anything here that can't be done by returning a dict, a <br>
> namedtuple (possibly with optional fields), or some other object with <br>
> named fields. They can be optional, they can have defaults, and you can <br>
> extend the object by adding new fields without breaking backwards <br>
> compatibility.<br>
<br>
That assumes you knew before hand to do that. The question is about the normal situation when you didn't. <br>
<br>
Also you totally disregarded the call site where there is no way to do a nice dict unpacking in python. The tuple case is super special and convenient but strictly worse than having properly named fields. <br>
<br>
To me this question sounds like it's about dict unpacking with one special case to keep backwards compatibility.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">My "destructure" module might help. I was playing around with the idea of dict unpacking and extended it to a kind of case matching.</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/selik/destructure">https://github.com/selik/destructure</a><br></div><div dir="auto"><br></div><div dir="auto">Grant Jenks independently came to almost the same idea and implementation.</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>