Message212552
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. |
|
Date |
User |
Action |
Args |
2014-03-02 14:07:12 | exhuma | set | recipients:
+ exhuma, ncoghlan, pitrou, pmoody |
2014-03-02 14:07:12 | exhuma | set | messageid: <1393769232.45.0.718300020891.issue20825@psf.upfronthosting.co.za> |
2014-03-02 14:07:12 | exhuma | link | issue20825 messages |
2014-03-02 14:07:11 | exhuma | create | |
|