
+1 ;-) 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: *import *socket *for *ip *in *socket.gethostbyname_ex(socket.gethostname())[2]: print(ip) BR, George 2017-06-13 22:13 GMT+02:00 Thomas Güttler <guettliml@thomas-guettler.de>:
AFAIK the socket module returns plain tuples in Python3:
https://docs.python.org/3/library/socket.html
Why not use named tuples?
Regards, Thomas Güttler
-- I am looking for feedback for my personal programming guidelines: https://github.com/guettli/programming-guidelines _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/