Message340259
I am not owner of ipaddress module, so I don't know we should
support more form of masks.
On the other hand, IPv4Interface and IPv6Interface expose
netmask and hostmask attributes when address is not bytes or int.
These attributes are not documented. I assume it was added
accidentally, when coping some code from Network classes.
But there are test for these attributes.
NetmaskTestMixin_v4.test_valid_netmask runs for IPv4Network and IPv4Interface.
It checks these attributes when constructor argument is string.
https://github.com/python/cpython/blob/3c7931e514faf509a39c218c2c9f55efb434628f/Lib/test/test_ipaddress.py#L422-L440
For safety, I added these attributes always, instead of remove them.
PR-12836 is fixing it, and extracts methods for Network/Interface constructor
(a part of PR-12774). It doesn't add additional mask form support. |
|
Date |
User |
Action |
Args |
2019-04-15 10:59:18 | methane | set | recipients:
+ methane, ncoghlan, pmoody, berker.peksag, serhiy.storchaka, moritzs, xiang.zhang |
2019-04-15 10:59:18 | methane | set | messageid: <1555325958.14.0.234306980625.issue27860@roundup.psfhosted.org> |
2019-04-15 10:59:18 | methane | link | issue27860 messages |
2019-04-15 10:59:17 | methane | create | |
|