Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(127102)

Delta Between Two Patch Sets: Doc/library/ipaddress.rst

Issue 20480: Add ipaddress property to get reverse DNS name
Left Patch Set: Created 5 years, 9 months ago
Right Patch Set: Created 5 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/ipaddress.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 :mod:`ipaddress` --- IPv4/IPv6 manipulation library 1 :mod:`ipaddress` --- IPv4/IPv6 manipulation library
2 =================================================== 2 ===================================================
3 3
4 .. module:: ipaddress 4 .. module:: ipaddress
5 :synopsis: IPv4/IPv6 manipulation library. 5 :synopsis: IPv4/IPv6 manipulation library.
6 .. moduleauthor:: Peter Moody 6 .. moduleauthor:: Peter Moody
7 7
8 **Source code:** :source:`Lib/ipaddress.py` 8 **Source code:** :source:`Lib/ipaddress.py`
9 9
10 -------------- 10 --------------
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 set to zero, these two attributes are always the same as ``str(addr)`` 146 set to zero, these two attributes are always the same as ``str(addr)``
147 for IPv4 addresses. Exposing these attributes makes it easier to 147 for IPv4 addresses. Exposing these attributes makes it easier to
148 write display code that can handle both IPv4 and IPv6 addresses. 148 write display code that can handle both IPv4 and IPv6 addresses.
149 149
150 .. attribute:: packed 150 .. attribute:: packed
151 151
152 The binary representation of this address - a :class:`bytes` object of 152 The binary representation of this address - a :class:`bytes` object of
153 the appropriate length (most significant octet first). This is 4 bytes 153 the appropriate length (most significant octet first). This is 4 bytes
154 for IPv4 and 16 bytes for IPv6. 154 for IPv4 and 16 bytes for IPv6.
155 155
156 .. attribute:: reverse_pointer 156 .. attribute:: reverse_pointer
eric.smith 2014/02/02 09:23:05 Needs a versionadded tag. I think we should expli
157 157
158 The name of the reverse DNS pointer for the IP address, e.g.:: 158 The name of the reverse DNS PTR record for the IP address, e.g.::
159 159
160 >>> ipaddress.ip_address("127.0.0.1").reverse_pointer 160 >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
161 '1.0.0.127.in-addr.arpa.' 161 '1.0.0.127.in-addr.arpa'
162 >>> ipaddress.ip_address("2001:db8::1").reverse_pointer 162 >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
163 '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.a rpa.' 163 '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.a rpa'
164 164
165 This is the name that could be used for performing a PTR lookup, not the
166 resolved hostname itself.
167
168 .. versionadded:: 3.5
165 169
166 .. attribute:: is_multicast 170 .. attribute:: is_multicast
167 171
168 ``True`` if the address is reserved for multicast use. See 172 ``True`` if the address is reserved for multicast use. See
169 :RFC:`3171` (for IPv4) or :RFC:`2373` (for IPv6). 173 :RFC:`3171` (for IPv4) or :RFC:`2373` (for IPv6).
170 174
171 .. attribute:: is_private 175 .. attribute:: is_private
172 176
173 ``True`` if the address is allocated for private networks. See 177 ``True`` if the address is allocated for private networks. See
174 iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry 178 iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 module defines the following exceptions: 819 module defines the following exceptions:
816 820
817 .. exception:: AddressValueError(ValueError) 821 .. exception:: AddressValueError(ValueError)
818 822
819 Any value error related to the address. 823 Any value error related to the address.
820 824
821 825
822 .. exception:: NetmaskValueError(ValueError) 826 .. exception:: NetmaskValueError(ValueError)
823 827
824 Any value error related to the netmask. 828 Any value error related to the netmask.
LEFTRIGHT
« no previous file | Lib/ipaddress.py » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+