-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
ipaddress.IPv4Address.is_global not implemented #65585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Lib/ipaddress.py does not implement is_global for IPv4Address, in contrast to the documentation which states for IPv4Address.is_global: "True if the address is allocated for public networks." A patch like the one attached to this report should fix that. |
The patch looks correct to me, but we also need tests. |
New patch includes tests. Lightly tested with Python 3.4 (because trunk doesn't build for me right now): tests fail without patch, pass with patch. Patch re-diffed against trunk. |
+ @Property Can IPv4Network('100.64.0.0/10') moved to the _IPv4Constants class (e.g. _IPv4Constants._global_network = IPv4Network('100.64.0.0/10')) after http://hg.python.org/cpython/rev/e5d963cb6afc (see also bpo-21513) + not self.is_private) |
Seeing that the patch merged for bpo-21513 left the existing test for 100.64.0.0 (IPv4 network) untouched, I think it would make more sense to make that address a constant everywhere in a separate patch (if that is indeed desirable). |
Here is an updated patch that uses my proposal in msg219017. Since this is already documented at https://docs.python.org/3.5/library/ipaddress.html#ipaddress.IPv4Address.is_global I think it should also go into 3.5. |
New changeset d65191861599 by Berker Peksag in branch '3.5': New changeset 1519ca772e54 by Berker Peksag in branch 'default': |
Thanks Roger! |
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: