Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.dockerignore | D | 03-May-2024 | 30 | 4 | 3 | |
.gitignore | D | 03-May-2024 | 312 | 37 | 30 | |
.travis.yml | D | 03-May-2024 | 300 | 19 | 18 | |
Android.bp | D | 03-May-2024 | 1.2 KiB | 44 | 40 | |
LICENSE | D | 03-May-2024 | 2.5 KiB | 51 | 41 | |
MANIFEST.in | D | 03-May-2024 | 53 | 3 | 2 | |
METADATA | D | 03-May-2024 | 366 | 20 | 19 | |
MODULE_LICENSE_PSF | D | 03-May-2024 | 0 | |||
Makefile | D | 03-May-2024 | 1.1 KiB | 46 | 32 | |
OTHER_BACKPORTS.md | D | 03-May-2024 | 4.3 KiB | 57 | 36 | |
README | D | 03-May-2024 | 921 | 29 | 24 | |
README.md | D | 03-May-2024 | 921 | 29 | 24 | |
ipaddress.py | D | 03-May-2024 | 78 KiB | 2,421 | 1,802 | |
setup.cfg | D | 03-May-2024 | 63 | 6 | 4 | |
setup.py | D | 03-May-2024 | 1.2 KiB | 36 | 30 | |
test-python2.6.Dockerfile | D | 03-May-2024 | 204 | 9 | 6 | |
test-python2.7.Dockerfile | D | 03-May-2024 | 256 | 12 | 9 | |
test-python3.2.Dockerfile | D | 03-May-2024 | 200 | 9 | 6 | |
test-python3.3.Dockerfile | D | 03-May-2024 | 202 | 9 | 6 | |
test_ipaddress.py | D | 03-May-2024 | 93.1 KiB | 2,238 | 1,789 |
README
1ipaddress 2========= 3 4Python 3.3+'s [ipaddress](http://docs.python.org/dev/library/ipaddress) for Python 2.6, 2.7, 3.2. 5 6This repository tracks the latest version from cpython, e.g. ipaddress from cpython 3.8 as of writing. 7 8Note that just like in Python 3.3+ you must use character strings and not byte strings for textual IP address representations: 9 10```python 11>>> from __future__ import unicode_literals 12>>> ipaddress.ip_address('1.2.3.4') 13IPv4Address(u'1.2.3.4') 14``` 15or 16```python 17>>> ipaddress.ip_address(u'1.2.3.4') 18IPv4Address(u'1.2.3.4') 19``` 20but not: 21```python 22>>> ipaddress.ip_address(b'1.2.3.4') 23Traceback (most recent call last): 24 File "<stdin>", line 1, in <module> 25 File "ipaddress.py", line 163, in ip_address 26 ' a unicode object?' % address) 27ipaddress.AddressValueError: '1.2.3.4' does not appear to be an IPv4 or IPv6 address. Did you pass in a bytes (str in Python 2) instead of a unicode object? 28``` 29
README.md
1ipaddress 2========= 3 4Python 3.3+'s [ipaddress](http://docs.python.org/dev/library/ipaddress) for Python 2.6, 2.7, 3.2. 5 6This repository tracks the latest version from cpython, e.g. ipaddress from cpython 3.8 as of writing. 7 8Note that just like in Python 3.3+ you must use character strings and not byte strings for textual IP address representations: 9 10```python 11>>> from __future__ import unicode_literals 12>>> ipaddress.ip_address('1.2.3.4') 13IPv4Address(u'1.2.3.4') 14``` 15or 16```python 17>>> ipaddress.ip_address(u'1.2.3.4') 18IPv4Address(u'1.2.3.4') 19``` 20but not: 21```python 22>>> ipaddress.ip_address(b'1.2.3.4') 23Traceback (most recent call last): 24 File "<stdin>", line 1, in <module> 25 File "ipaddress.py", line 163, in ip_address 26 ' a unicode object?' % address) 27ipaddress.AddressValueError: '1.2.3.4' does not appear to be an IPv4 or IPv6 address. Did you pass in a bytes (str in Python 2) instead of a unicode object? 28``` 29