[Python-Dev] PEP 3144 review.

Antoine Pitrou solipsis at pitrou.net
Wed Sep 16 22:35:30 CEST 2009


Le Mon, 14 Sep 2009 09:44:12 -0700, Peter Moody a écrit :
> Folks, Guido,
> 
> I believe PEP 3144 is ready for your review.  When you get a chance, can
> you take a look/make a pronouncement?

Besides what has already been said in the thread, I have a bunch of 
comments:

    It should be noted
    that __len__ doesn't work as expected since python internals has this
    limited to a 32 bit integer and it would need to be at least 128 bits 
to
    work with IPV6.

You should clarify what it means: does the result get truncated, or is an 
error thrown when it can't fit inside an int?

    1. all IP addresses and networks, both IPv4 and IPv6. (IPAddrBase)

    2. all IP addresses of both versions. (BaseIP)

    3. all IP networks of both version. (BaseNet)

    4. all IPv4 objects, both addresses and networks. (BaseV4)

    5. all IPv6 objects, both addresses and networks. (BaseV6)

Should those base classes be exposed publically? It may make life more 
difficult if an alternate implementation (say, a C accelerator) wants to 
adopt a different code sharing strategy.

If they are not to be part of the public API, their names should be 
prefixed with an underscore.




More information about the Python-Dev mailing list