<div dir="ltr"><div><div><div>+1 ;-)<br><br></div>for example to get IP address of all interfaces we have to use the third (indexed as 2) member of "something" it is much more beatiful to get ip_address:<br><br><b><span style="font-size:10pt;font-family:"Courier New";color:navy">import
</span></b><span style="font-size:10pt;font-family:"Courier New";color:black">socket<br>
</span><b><span style="font-size:10pt;font-family:"Courier New";color:navy">for
</span></b><span style="font-size:10pt;font-family:"Courier New";color:black">ip
</span><b><span style="font-size:10pt;font-family:"Courier New";color:navy">in </span>
</b><span style="font-size:10pt;font-family:"Courier New";color:black">socket.gethostbyname_ex(<wbr>socket.gethostname())[</span><span style="font-size:10pt;font-family:"Courier New";color:blue">2</span><span style="font-size:10pt;font-family:"Courier New";color:black">]:<br>
    </span><span style="font-size:10pt;font-family:"Courier New";color:navy">print</span><span style="font-size:10pt;font-family:"Courier New";color:black">(ip)<br><br></span></div><span style="font-size:10pt;font-family:"Courier New";color:black">BR,<br></span></div><span style="font-size:10pt;font-family:"Courier New";color:black">George<br></span><div><div><span style="font-size:10pt;font-family:"Courier New";color:black"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-13 22:13 GMT+02:00 Thomas Güttler <span dir="ltr"><<a href="mailto:guettliml@thomas-guettler.de" target="_blank">guettliml@thomas-guettler.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">AFAIK the socket module returns plain tuples in Python3:<br>
<br>
  <a href="https://docs.python.org/3/library/socket.html" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>library/socket.html</a><br>
<br>
Why not use named tuples?<br>
<br>
Regards,<br>
  Thomas Güttler<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
I am looking for feedback for my personal programming guidelines:<br>
<a href="https://github.com/guettli/programming-guidelines" rel="noreferrer" target="_blank">https://github.com/guettli/<wbr>programming-guidelines</a><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>
</font></span></blockquote></div><br></div>