[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

Lord Anton Hvornum report at bugs.python.org
Tue Sep 26 16:46:30 EDT 2017


Lord Anton Hvornum added the comment:

I was actually just thinking about the same thing, why not just add a
optional flag to the already existing function.
I get that people are way into backward compatibility, and I won't get into
a religious fight over that particular topic as long as there's a fix for
this honestly strange behavior. (It's some Windows mentality saying a /32
network doesn't contain any hosts when you come from a network background).

Seeing as this is apparently a touchy subject, I won't even try to submit a
patch for this because I will screw this up.
So I politely ask someone with more intricate knowledge of this library,
it's history and use to add a totally optional flag that returns the single
host on this very narrow network called /32.

On Tue, Sep 26, 2017 at 10:33 PM Eric V. Smith <report at bugs.python.org>
wrote:

>
> Eric V. Smith added the comment:
>
> Yes, due to backward compatibility constraints, the behavior is immutable.
>
> You might be able to argue for another method, say all_hosts(), or
> something. Or maybe even a optional parameter to hosts() that defaults to
> the existing behavior, but if provided, lets you select a new behavior.
>
> What I would not support is a change to hosts() (or a new method) that
> treats a /32 network specially.
>
> ----------
> nosy: +eric.smith
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue31597>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31597>
_______________________________________


More information about the Python-bugs-list mailing list