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

Side by Side Diff: Doc/library/ipaddress.rst

Issue 20480: Add ipaddress property to get reverse DNS name
Patch Set: Created 5 years, 7 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:
View unified diff | Download patch
« no previous file with comments | « no previous file | Lib/ipaddress.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 As IPv4 does not define a shorthand notation for addresses with octets 145 As IPv4 does not define a shorthand notation for addresses with octets
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
156 .. attribute:: reverse_name
157
158 The reverse DNS name of the IP address, e.g.::
159
160 >>> ipaddress.ip_address("127.0.0.1").reverse_name
161 '1.0.0.127.in-addr.arpa.'
162 >>> ipaddress.ip_address("2001:db8::1").reverse_name
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
155 165
156 .. attribute:: is_multicast 166 .. attribute:: is_multicast
157 167
158 ``True`` if the address is reserved for multicast use. See 168 ``True`` if the address is reserved for multicast use. See
159 :RFC:`3171` (for IPv4) or :RFC:`2373` (for IPv6). 169 :RFC:`3171` (for IPv4) or :RFC:`2373` (for IPv6).
160 170
161 .. attribute:: is_private 171 .. attribute:: is_private
162 172
163 ``True`` if the address is allocated for private networks. See 173 ``True`` if the address is allocated for private networks. See
164 iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry 174 iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 zeroes collapsed to a single empty group. 229 zeroes collapsed to a single empty group.
220 230
221 This is also the value returned by ``str(addr)`` for IPv6 addresses. 231 This is also the value returned by ``str(addr)`` for IPv6 addresses.
222 232
223 .. attribute:: exploded 233 .. attribute:: exploded
224 234
225 The long form of the address representation, with all leading zeroes and 235 The long form of the address representation, with all leading zeroes and
226 groups consisting entirely of zeroes included. 236 groups consisting entirely of zeroes included.
227 237
228 .. attribute:: packed 238 .. attribute:: packed
239 .. attribute:: reverse_name
229 .. attribute:: version 240 .. attribute:: version
230 .. attribute:: max_prefixlen 241 .. attribute:: max_prefixlen
231 .. attribute:: is_multicast 242 .. attribute:: is_multicast
232 .. attribute:: is_private 243 .. attribute:: is_private
233 .. attribute:: is_unspecified 244 .. attribute:: is_unspecified
234 .. attribute:: is_reserved 245 .. attribute:: is_reserved
235 .. attribute:: is_loopback 246 .. attribute:: is_loopback
236 .. attribute:: is_link_local 247 .. attribute:: is_link_local
237 248
238 Refer to the corresponding attribute documentation in 249 Refer to the corresponding attribute documentation in
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 module defines the following exceptions: 815 module defines the following exceptions:
805 816
806 .. exception:: AddressValueError(ValueError) 817 .. exception:: AddressValueError(ValueError)
807 818
808 Any value error related to the address. 819 Any value error related to the address.
809 820
810 821
811 .. exception:: NetmaskValueError(ValueError) 822 .. exception:: NetmaskValueError(ValueError)
812 823
813 Any value error related to the netmask. 824 Any value error related to the netmask.
OLDNEW
« no previous file with comments | « no previous file | Lib/ipaddress.py » ('j') | no next file with comments »

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