Title: ipaddress.IPv{4,6}Network.reverse_pointer is broken
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bbayles, ekohl, h.venev, pmoody, ronaldoussoren
Priority: normal Keywords: patch

Created on 2017-05-31 17:15 by h.venev, last changed 2018-03-13 14:25 by ronaldoussoren.

Pull Requests
URL Status Linked Edit
PR 3632 open ekohl, 2017-09-17 22:50
Messages (5)
msg294854 - (view) Author: Hristo Venev (h.venev) * Date: 2017-05-31 17:15
`ipaddress.IPv4Network('').reverse_pointer = '0/'` is definitely wrong. I think it should be ''.

A funnier case, `ipaddress.IPv6Network('2001:db8::/32').reverse_pointer = '2.3./'`.

For the case where no single reverse pointer exists (e.g. ``), I think it should be `None`.
msg302390 - (view) Author: Ewoud Kohl van Wijngaarden (ekohl) * Date: 2017-09-17 22:52
Today I ran into this as well. In the case of IPv6 it's simple to decide what should be returned but on the IPv4Network I disagree. My expectation would be the domain where I would make the reverse needed. That means for it should be ''.

I implemented it this way in the linked PR but I'm open to other opinions.
msg311869 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2018-02-09 08:26
<> documents that this attribute contains the name of the DNS name that could be used to query for PTR record. 

That functionality is not well defined for a network object. It might therefore be better to just raise an exception for this attribute on network objects.
msg313675 - (view) Author: Ewoud Kohl van Wijngaarden (ekohl) * Date: 2018-03-12 18:16
It's interesting to note that neither IPv4Network[1] nor IPv4Network docs mention reverse_pointer. That means it could also remove them (which essentially also throws an exception) since they don't make sense for networks. It would be useful to have the described functionality under a better name.

msg313750 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2018-03-13 14:25
The "reverse_pointers" attribute is implicitly documented by this phrase in the introduction of network objects:

All attributes implemented by address objects are implemented by network objects as well.
Date User Action Args
2018-03-13 14:25:06ronaldoussorensetmessages: + msg313750
2018-03-13 13:47:33bbaylessetnosy: + bbayles
2018-03-12 18:16:08ekohlsetmessages: + msg313675
2018-02-09 08:26:56ronaldoussorensetnosy: + ronaldoussoren
messages: + msg311869
2018-02-04 19:47:52cheryl.sabellasetnosy: + pmoody
2017-09-17 22:52:00ekohlsetnosy: + ekohl
messages: + msg302390
2017-09-17 22:50:59ekohlsetkeywords: + patch
stage: patch review
pull_requests: + pull_request3621
2017-05-31 17:15:31h.venevcreate