[issue42478] ipaddress.IPv4network.interfaces()

2020-11-28 Thread Wyko ter Haar


Wyko ter Haar  added the comment:

You bet. Totally forgot when I was replying on my phone :)

--

___
Python tracker 
<https://bugs.python.org/issue42478>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-27 Thread Wyko ter Haar


Wyko ter Haar  added the comment:

Starting at .1, not .0.

Sincerely,

Wyko ter Haar

On Fri, Nov 27, 2020, 10:14 AM Wyko ter Haar 
wrote:

> >>> 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 
> wrote:
>
>>
>> Wyko ter Haar  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 
>> wrote:
>>
>> >
>> > Eric V. Smith  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 
>> > <https://bugs.python.org/issue42478>
>> > ___
>> >
>>
>> --
>>
>> ___
>> Python tracker 
>> <https://bugs.python.org/issue42478>
>> ___
>>
>

--

___
Python tracker 
<https://bugs.python.org/issue42478>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-27 Thread Wyko ter Haar


Wyko ter Haar  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  wrote:

>
> Wyko ter Haar  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 
> wrote:
>
> >
> > Eric V. Smith  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 
> > <https://bugs.python.org/issue42478>
> > ___
> >
>
> --
>
> ___
> Python tracker 
> <https://bugs.python.org/issue42478>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue42478>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-27 Thread Wyko ter Haar


Wyko ter Haar  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  wrote:

>
> Eric V. Smith  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 
> <https://bugs.python.org/issue42478>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue42478>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-26 Thread Wyko ter Haar


New submission from Wyko ter Haar :

It would be really nice if we could get an iterator just like 
ip_network.hosts() that iterates over the interfaces in a subnet.

--
messages: 381921
nosy: wyko.ter.haar
priority: normal
severity: normal
status: open
title: ipaddress.IPv4network.interfaces()
type: enhancement
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue42478>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42477] ip_interface addition and subtraction changes netmask

2020-11-26 Thread Wyko ter Haar


New submission from Wyko ter Haar :

When increasing IPv4Interface('10.0.0.0/29)'  by 1, I would expect to get 
IPv4Interface('10.0.0.1/29') . Unfortunately, it seems to change the netmask on 
it as well. That seems really unintuitive to me.

For example:
>>> ip_interface('10.0.0.0/24')
IPv4Interface('10.0.0.0/24')
>>>
>>> ip_interface('10.0.0.0/24')+1
IPv4Interface('10.0.0.1/32')

--
messages: 381918
nosy: wyko.ter.haar
priority: normal
severity: normal
status: open
title: ip_interface addition and subtraction changes netmask
type: behavior
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue42477>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com