[Python-Dev] PEP 3144 review.
Antoine Pitrou
solipsis at pitrou.net
Mon Sep 28 22:14:32 CEST 2009
Martin v. Löwis <martin <at> v.loewis.de> writes:
>
> Still, people proposing that 192.168.1.1/24 should be rejected (I still
> don't know whether anybody is actually proposing that) *have* to provide
> a proposal how this should be input instead.
It was proposed to have a dedicated function or class method which would parse
such strings and return a (Network, Address) tuple corresponding to the two
objects that are described by that single notation.
>>> parse_network_and_host('192.168.1.1/24')
(Network('192.168.1.0/24'), Address('192.168.1.1'))
Regards
Antoine.
More information about the Python-Dev
mailing list