Michel Albert added the comment:

Hmm... after thinking about this, I kind of agree. I was about to state 
something about the fact that you could consider networks like an "ordered 
set". And use that to justify my addition :) But the more I think about it, the 
more I am okay with your point.

I quickly tested the following:

    >>> a = ip_network('10.0.0.0/24')
    >>> b = ip_network('10.0.0.0/30')
    >>> a <= b
    True
    >>> b <= a
    False

Which is wrong when considering "containement".

What about an instance-method? Something like ``b.contained_in(a)``?

At least that would be explicit and avoids confusion. Because the existing 
``__lt__`` implementation makes sense in the way it's already used.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20825>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to