[issue20825] containment test for "ip_network in ip_network"

Michel Albert report at bugs.python.org
Sat Jun 25 09:46:49 EDT 2016


Michel Albert added the comment:

I don't quite see how the operator module could help. I don't have much experience with it though, so I might be missing something...

I don't see how I can relate one check to the other. The example I gave in the patch review was the following:

With the existing implementation:

'192.168.1.0/25' subnet of '192.168.1.128/25' -> False
'192.168.1.0/25' supernet of '192.168.1.128/25' -> False

With the proposal to simply return "not subnet_of(...)" it would become:

'192.168.1.0/25' subnet of '192.168.1.128/25' -> False
'192.168.1.0/25' supernet of '192.168.1.128/25' -> True

which would be wrong.


I have now added the new test-cases for the TypeError and removed the code-duplication by introducing a new "private" function. Let me know what you think.


I am running all test cases again and I'll uploaded it once they finished.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20825>
_______________________________________


More information about the Python-bugs-list mailing list