A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-September/091727.html below:

[Python-Dev] PEP 3144 review.

[Python-Dev] PEP 3144 review. [Python-Dev] PEP 3144 review.Antoine Pitrou solipsis at pitrou.net
Tue Sep 15 20:43:59 CEST 2009
R. David Murray <rdmurray <at> bitdance.com> writes:
> 
>      x = IPv4AddressWithMask('192.168.1.1/24')
>      x.network == IPv4Network('192.168.1.0/24')
>      x.network[1] == x

I don't think we need an IPAddressWithMask which would just complicate the API
without any obvious benefit.
We just need a factory function which returns a tuple after parsing:

    >>> addr, net = parse_address_with_mask('192.168.1.1/24')
    >>> addr == IPv4Address('192.168.1.1')
    True
    >>> net == IPv4Network('192.168.1.0/24')
    True

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4