[New-bugs-announce] [issue36392] IPv4Interface Object has no attributte prefixlen
Eddgar Rojas
report at bugs.python.org
Thu Mar 21 15:45:12 EDT 2019
New submission from Eddgar Rojas <guabeff at gmail.com>:
The python the Class IPv4Interface on the ipaddress module when I try to use the .prefixlen attribute it says that do not exist but is i have access by using ._prefixlen
if i have on the IPv4Interface class the .netmask attribute and the .nethost attribute Why not the .prefixlen attribute?,
I reported like a bug as i think that attribute should appear on the IPv4Interface Class
Below test I did
>>> import ipaddress as ip
>>> addr = ip.ip_interface('192.168.1.1/24')
>>> addr.prefixlen
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'IPv4Interface' object has no attribute 'prefixlen'
>>> addr.netmask
IPv4Address('255.255.255.0')
>>> addr._prefixlen
24
----------
components: Library (Lib)
messages: 338566
nosy: Eddgar Rojas
priority: normal
severity: normal
status: open
title: IPv4Interface Object has no attributte prefixlen
type: behavior
versions: Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36392>
_______________________________________
More information about the New-bugs-announce
mailing list