On Sun, Sep 27, 2009 at 1:15 PM, Antoine Pitrou <solip...@pitrou.net> wrote: > Peter Moody <peter <at> hda3.com> writes: >> >> On Sun, Sep 27, 2009 at 12:40 PM, James Y Knight <foom <at> fuhm.net> wrote: >> > >> > On Sep 27, 2009, at 3:18 PM, Peter Moody wrote: >> > >> >> administrators) would use it, but it's doable. what you're claiming is >> >> that my use case is invalid. >> >> >> >> that's what I claim is broken. >> > >> > He's claiming your solution to address your use case is confusing, not that >> > the use case is invalid. >> >> this isn't actually true. >> >> Steven D'Aprano wrote: > [...] > > That's Steven, your original sentence was about me.
my original sentence was about everyone who was arguing that the current implementation was designed for an invalid use-case. it was in reply to your email, but it was to everyone (you, Nick, rdm, Steven, etc) >> > 1) if strict=False, mask off the bits described by the netmask when >> > creating >> > an IPNetwork, such that the host bits are always 0. >> >> I haven't heard anyone suggest auto-masking bits, but otherwise that >> would be strict=True. > > I would expect strict=True to raise an error if the lower bits are non-zero, > not > to silently erase them. strict=False would be the option that silently erases > lower bits. > (that's why it's named `strict`, after all :-)) > >> > 2) add a single new function: >> > >> > 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)? > Regards > > Antoine. > > > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/options/python-dev/python-dev%40hda3.com > _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com