You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd expect the IPv4 address to be considered part of that network (or actually parsed as an IPv4Address and not IPv6Address) even if it's written in IPv6 notation. It's an IPv4 after all.
Python 3.5.1 (default, Jun 7 2016, 09:20:44)
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> ipaddress.ip_address('::ffff:127.0.0.1')
IPv6Address('::ffff:7f00:1')
>>> ipaddress.ip_address('::ffff:127.0.0.1') in ipaddress.ip_network('127.0.0.0/8')
False
>>> ipaddress.ip_address('127.0.0.1') in ipaddress.ip_network('127.0.0.0/8')
True
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).
It is not said if exception will be raised if incompatible objects are used, and not said if result is defined.
"Unless stated otherwise" - Seem it is stated nowhere.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: