Марк Коренберг added the comment: Also, it should be marked explicitly, if cross-type lookup is safe. I mean code like that:
some_net = ipaddress.ip_network(some_input1) some_addr = ipaddress.ip_address(some_input2) return some_addr in some_net Is it safe to write such code? Docs say: 21.28.2.3. Operators Address objects support some operators. Unless stated otherwise, operators can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 with IPv6). 1. It is not said if exception will be raised if incompatible objects are used, and not said if result is defined. 2. "Unless stated otherwise" - Seem it is stated nowhere. ---------- assignee: -> docs@python components: +Documentation nosy: +docs@python _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27269> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com