phihag / ipaddress

Python 3.3+'s ipaddress for older Python versions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Python 3.3+ with importing through another package name

maticomp opened this issue · comments

Hi there!

I like this backport a lot - it comes in handy often. It is assumed it's a backport of 3.3+ ipaddress to older Python versions, but in fact it's a backport of a much fresher version, which is even cooler.

The point is, when you install that package, it yields ipaddress.py in your sitepackages, so there is no non-hackish way of importing this version of ipaddress over a system module in Python 3.3+.

I'm working with API parts fully supported in Python 3.7 and this backport, but not available in Python 3.3s version of the module (IPv4Constants, subnet_of, supernet_of introduced in 3.7). It works perfectly fine with Python 3.7 with native module and in Python 2.7 when the backport is imported, but import ipaddress` in Python 3.3+,<3.7 uses the system module over the backport, and does not expose the fresher API.

It would be nice if the package was also available under a different, non-shadowing name, so it can be explicitly imported to be used with any Python version.

Sorry for the long delay. @maticomp is there still interest in a secondary name?

No worries @phihag. For me personally, definitely no longer an issue. I've been able to upgrade the tooling everywhere and in all projects where ipaddress was important to me we are on 3.8 now. 😉