A RetroSearch Logo

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

Search Query:

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

[Python-Dev] PEP 3144 review.

[Python-Dev] PEP 3144 review.Antoine Pitrou solipsis at pitrou.net
Sun Sep 27 22:49:15 CEST 2009
Peter Moody <peter <at> hda3.com> writes:
> 
> >> > def parse_net_and_addr(s):
> >> >  return (IPNetwork(s), IPAddress(s.split('/')[0]))
> >>
> >> I've only heard talk of new classes and new methods, not new
> >> constructor functions.
> >
> > Well, "method" in that context meant "class method" since the results aren't
> > dependent on a particular instance. Of course, both a class method or a
> > module-level function would be fine.
> 
> so this is not the response I got when I asked what was required
> before. Would adding this constructor function satisfy your concerns
> (given sensible strict settings in the constructor, etc)?

Assuming the Network type loses the notion of a specific host (or host address,
or `ip`) attached to it, yes.

Or to put it more clearly:

>>> Network('192.168.0.1/24', strict=False)
Network('192.168.0.0/24')
>>> Network('192.168.0.1/24', strict=False) == Network('192.168.0.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