[Python-Dev] PEP 3144 review.

Guido van Rossum guido at python.org
Wed Sep 30 04:48:04 CEST 2009


On Tue, Sep 29, 2009 at 7:12 PM, R. David Murray <rdmurray at bitdance.com> wrote:
> On Wed, 30 Sep 2009 at 11:07, Nick Coghlan wrote:
>>
>> At the risk of bikeshedding a bit, I'm still somewhat uncomfortable with
>> the "net.network" and "net.ip" attribute names. RDMs example application
>> elicited the reason for that discomfort pretty well: the current naming
>> seems like an invitation to write code using 'net.ip' that should have
>> used 'net.network' instead. Such code will then work correctly most of
>> the time (i.e. when only given normalised IPNetwork objects) but will
>> fail when given a denormalised one.
>>
>> I believe that discomfort could be eliminated best by changing the name
>> of the ".ip" attribute to ".host_ip" to make it clear that it is
>> referring to the IP address of the host that was used to derive the
>> network definition rather than referring to the network ID itself.
>> Shortening ".network" to ".net_ip" would also help (this latter change
>> would also eliminate the mental disconnect caused by an attribute called
>> .network returning an IPAddress instance).
>
> +1

+1 on that it's a bikeshed.

+0 on renaming .ip to something longer.

-0 on renaming .network.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list