Wyko ter Haar <[email protected]> added the comment:
>>> X = ip_network("10.0.0.0/24")
>>> H= X.hosts(as_interfaces= True)
>>> next(H)
IPv4Interface('10.0.0.0/24')
>>> next(H)
IPv4Interface('10.0.0.1/24')
Something like that. Sure, I could cast the output of hosts as an
interface, but then it would be missing the netmask.
Sincerely,
Wyko ter Haar
On Fri, Nov 27, 2020, 10:04 AM Wyko ter Haar <[email protected]> wrote:
>
> Wyko ter Haar <[email protected]> added the comment:
>
> Literally just the same thing as .hosts(), except outputting interface
> objects instead of addresses. Maybe it could be a flag in .hosts() instead,
> something like "cast_as_interface".
>
> Sincerely,
>
> Wyko ter Haar
>
> On Fri, Nov 27, 2020, 3:18 AM Eric V. Smith <[email protected]>
> wrote:
>
> >
> > Eric V. Smith <[email protected]> added the comment:
> >
> > I'm not sure what you mean by iterating over the interfaces in a subnet.
> > Could you give an example?
> >
> > ----------
> > nosy: +eric.smith
> >
> > _______________________________________
> > Python tracker <[email protected]>
> > <https://bugs.python.org/issue42478>
> > _______________________________________
> >
>
> ----------
>
> _______________________________________
> Python tracker <[email protected]>
> <https://bugs.python.org/issue42478>
> _______________________________________
>
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42478>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com