New submission from era:

I would expect the following code to return ['10.9.8.8'] but it returns an 
empty list.

    yosemite-osx$ python3
    Python 3.5.1 (default, Dec 26 2015, 18:08:53) 
    [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import ipaddress
    >>> list(ipaddress.ip_network('10.9.8.7/32').hosts())
    []

This seems to happen for every /32 address.  I'm guessing the logic which wants 
to exclude the gateway and broadcast addresses from a block should treat a /32 
as a special case.

I tried to look for a previous bug submission but I could not find one.  As 
such, it seems peculiar if this has not been reported before.  Is this actually 
expected behavior by some rule I am overlooking?

I tested on Linux 3.4 and OSX Yosemite Homebrew / Python 3.5.1.

----------
components: Library (Lib)
messages: 279855
nosy: era
priority: normal
severity: normal
status: open
title: ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28577>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to