[Python-Dev] [Python-checkins] cpython: Issue #14814: addition of the ipaddress module (stage 1 - code and tests)

Sandro Tosi sandro.tosi at gmail.com
Tue May 22 21:59:20 CEST 2012


Thanks Terry for the review! I've attached a patch to issue14814
addressing your points; but..

On Sun, May 20, 2012 at 7:18 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> +def _get_prefix_length(number1, number2, bits):
>> +    """Get the number of leading bits that are same for two numbers.
>> +
>> +    Args:
>> +        number1: an integer.
>> +        number2: another integer.
>> +        bits: the maximum number of bits to compare.
>> +
>> +    Returns:
>> +        The number of leading bits that are the same for two numbers.
>> +
>> +    """
>> +    for i in range(bits):
>> +        if number1>>  i == number2>>  i:
>
>
> This non-PEP8 spacing is awful to read. The double space after the tighter
> binding operator is actively deceptive. Please use
>
>        if number1 >> i == number2 >> i:

I don't see this (and all the other) spacing issue you mentioned. Is
it possible that your mail client had played some "funny" tricks?

>> +    Args:
>> +        first: the first IPv4Address or IPv6Address in the range.
>> +        last: the last IPv4Address or IPv6Address in the range.
>> +
>> +    Returns:
>> +        An iterator of the summarized IPv(4|6) network objects.
>
> Very clear as to types.

I don't think I get exactly what you mean here.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the Python-Dev mailing list