[Python-Dev] PEP 3144 review.

Stephen J. Turnbull stephen at xemacs.org
Wed Sep 30 05:24:29 CEST 2009

Peter Moody writes:

 > >  > this is interesting. I would be open to doing this and making __lt__,
 > >  > __gt__, __eq__ and friends do the non-ip comparing by default. would
 > >  > this be sufficient or does the fact that the network has the .ip
 > >  > attribute break something pythonic?
 > >
 > > What do you mean, "by default"?  Surely you don't mean an equality
 > > method with some sort of flag!?
 > no, I mean setting it up so that if I want to compare two network
 > objects and take into account their .ip attribute, that I use a
 > .compare_with_extra_bits() method or something.  __eq__, __ne__,
 > __lt__, __le__, __gt__, __ge__ (any more?) would all only compare
 > .network and .prefixlen (as you have in your example).

OK.  My position is that I'd appreciate it if you would review some of
the existing bikeshedding to see if there are any acceptable tweaks to
make more people a little happier, but as of now I'm +1 on the design.

More information about the Python-Dev mailing list