Skip to content
Snippets Groups Projects
Commit 73ed9c7e authored by Erik Reid's avatar Erik Reid
Browse files

added a docstring

parent d3d956cf
No related branches found
No related tags found
No related merge requests found
......@@ -322,6 +322,14 @@ def local_interfaces(
type=netifaces.AF_INET,
omit_link_local=True,
omit_loopback=True):
"""
generator yielding IPv4Interface or IPv6Interface objects,
depending on the value of type
:param type: hopefully AF_INET or AF_INET6
:param omit_link_local: skip v6 fe80* addresses if true
:param omit_loopback: skip lo* interfaces if true
:return:
"""
for n in netifaces.interfaces():
if omit_loopback and re.match(r'^lo\d+', n):
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment