<div dir="ltr">Barry, you're taking the metaphor too far. Duct typing is about presenting a certain interface. If your function takes an object that has a <font face="monospace, monospace">get(key, default)</font> method, the rest doesn't matter. That's the only way in which the object needs to resemble a duck in your function.<br><br>I'd like to +1 this proposal. It should be trivial to implement. It won't break backward compatibility. It's intuitive. I can think of several places I would use it. I can't think of a good reason not to include it.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 1, 2017 at 12:06 PM, Barry <span dir="ltr"><<a href="mailto:barry@barrys-emacs.org" target="_blank">barry@barrys-emacs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 1 Mar 2017, at 01:26, Michel Desmoulin <<a href="mailto:desmoulinmichel@gmail.com">desmoulinmichel@gmail.com</a>> wrote:<br>
><br>
> - you can iterate on both<br>
</span>Maybe, bit do you want the keys, values or (key, value) items? Keys being the deafult.<br>
<span class="">> - you can index both<br>
</span>Maybe as you cannot in the general case know the index. Need keys().<br>
<span class="">> - you can size both<br>
</span>Yes<br>
<br>
I think this duck cannot swim or quack.<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></div></blockquote></div><br></div>