Skip to content

Commit 5a7c602

Browse files
committed
Fix the grammar and improve docstrings of the Network classes.
1 parent 31142fe commit 5a7c602

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

‎Doc/library/ipaddress.rst‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,10 @@ dictionaries.
519519
The interpretation is similar to an integer *address*.
520520

521521
4. A two-tuple of an address description and a netmask, where the address
522-
description is either a string, a 32-bits integer, a 4-bytes packed
523-
integer, or an existing :class:`IPv4Address` object; and the netmask is either
524-
an integer representing the prefix length (e.g. ``24``) or a string
525-
representing the prefix mask (e.g. ``255.255.255.0``).
522+
description is either a string, a 32-bit integer, a 4-byte packed
523+
integer, or an existing :class:`IPv4Address` object; and the netmask is
524+
either an integer representing the prefix length (e.g. ``24``) or a
525+
string representing the prefix mask (e.g. ``255.255.255.0``).
526526

527527
An :exc:`AddressValueError` is raised if *address* is not a valid IPv4
528528
address. A :exc:`NetmaskValueError` is raised if the mask is not valid for
@@ -769,9 +769,9 @@ dictionaries.
769769
The interpretation is similar to an integer *address*.
770770

771771
4. A two-tuple of an address description and a netmask, where the address
772-
description is either a string, a 128-bits integer, a 16-bytes packed
773-
integer, or an existing :class:`IPv6Address` object; and the netmask is an
774-
integer representing the prefix length.
772+
description is either a string, a 128-bit integer, a 16-byte packed
773+
integer, or an existing :class:`IPv6Address` object; and the netmask is
774+
an integer representing the prefix length.
775775

776776
An :exc:`AddressValueError` is raised if *address* is not a valid IPv6
777777
address. A :exc:`NetmaskValueError` is raised if the mask is not valid for

‎Lib/ipaddress.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,10 @@ def __init__(self, address, strict=True):
15741574
integer representing the prefix length (e.g. 24) or a string
15751575
representing the prefix mask (e.g. '255.255.255.0').
15761576
1577+
strict: A boolean. If true, ensure that we have been passed
1578+
a true network address, eg, 192.0.2.0/24 and not an
1579+
IP address on a network, eg, 192.0.2.1/24.
1580+
15771581
Raises:
15781582
AddressValueError: If ipaddress isn't a valid IPv4 address.
15791583
NetmaskValueError: If the netmask isn't valid for
@@ -2365,14 +2369,14 @@ def __init__(self, address, strict=True):
23652369
IPv6Network(int(IPv6Network('2001:db8::'))) ==
23662370
IPv6Network('2001:db8::')
23672371
2368-
The address can also be a two-tuple of an address description
2369-
and a netmask, where the address description is either a
2370-
string, a 128-bits integer, a 16-bytes packed integer, or an
2371-
existing IPv6Address object; and the netmask is an integer
2372-
representing the prefix length.
2372+
The address can also be a two-tuple of an address description and
2373+
a netmask, where the address description is either a string, a
2374+
128-bit integer, a 16-byte packed integer, or an existing
2375+
IPv6Address object; and the netmask is an integer representing
2376+
the prefix length.
23732377
23742378
strict: A boolean. If true, ensure that we have been passed
2375-
A true network address, eg, 2001:db8::1000/124 and not an
2379+
a true network address, eg, 2001:db8::1000/124 and not an
23762380
IP address on a network, eg, 2001:db8::1/124.
23772381
23782382
Raises:

0 commit comments

Comments
 (0)