<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, May 27, 2016 at 11:38 AM Zachary Ware <<a href="mailto:zachary.ware%2Bpyideas@gmail.com">zachary.ware+pyideas@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, May 27, 2016 at 10:32 AM, Michael Selik <<a href="mailto:michael.selik@gmail.com" target="_blank">michael.selik@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, May 27, 2016 at 11:28 AM Zachary Ware<br>
> <<a href="mailto:zachary.ware%2Bpyideas@gmail.com" target="_blank">zachary.ware+pyideas@gmail.com</a>> wrote:<br>
>><br>
>> Here's a crazy thought that might be best dismissed out of hand: what<br>
>> about extending 'from name import other_names' to accept any object<br>
>> for <name>?  First try to get values via __getitem__() (possibly only<br>
>> for dict/dict subclasses?), next try getattr(), finally try to import<br>
>> the module and pull values from it as per usual.<br>
>><br>
>> Pros:<br>
>> - solves dict unpacking<br>
><br>
><br>
> Would it solve nested dict unpacking?<br>
<br>
How do you mean?  Replacing `some_name =<br>
some_dict['some_key']['some_name']` with `from some_dict['some_key']<br>
import some_name`?<br></blockquote><div><br></div><div>No, more like</div><div><span style="line-height:1.5">    py> {'name': name, 'location': {0: row, 1: col} = mapping</span><br></div><div><span style="line-height:1.5">    py> name, row, col</span></div><div><span style="line-height:1.5">    ('Mike', 3, 5)</span></div></div></div>