Skip to content

Commit 113a644

Browse files
Merge remote-tracking branch 'origin/master' into registered-domain-semantics
2 parents 9103aad + ffd6203 commit 113a644

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

tldextract/tldextract.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class ExtractResult:
109109

110110
@property
111111
def fqdn(self) -> str:
112-
"""Returns a Fully Qualified Domain Name (FQDN), if there is a proper `domain` and `suffix`, or else the empty string.
112+
"""The Fully Qualified Domain Name (FQDN), if there is a proper `domain` and `suffix`, or else the empty string.
113113
114114
>>> extract("http://forums.bbc.co.uk/path/to/file").fqdn
115115
'forums.bbc.co.uk'
@@ -122,7 +122,7 @@ def fqdn(self) -> str:
122122

123123
@property
124124
def ipv4(self) -> str:
125-
"""Returns the IPv4, if that is what the input domain/URL was, or else the empty string.
125+
"""The IPv4 address, if that is what the input domain/URL was, or else the empty string.
126126
127127
>>> extract("http://127.0.0.1/path/to/file").ipv4
128128
'127.0.0.1'
@@ -141,7 +141,7 @@ def ipv4(self) -> str:
141141

142142
@property
143143
def ipv6(self) -> str:
144-
"""Returns the IPv6, if that is what the input domain/URL was, or else the empty string.
144+
"""The IPv6 address, if that is what the input domain/URL was, or else the empty string.
145145
146146
>>> extract(
147147
... "http://[aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1]/path/to/file"
@@ -168,7 +168,7 @@ def ipv6(self) -> str:
168168

169169
@property
170170
def registered_domain(self) -> str:
171-
"""Joins the `domain` and `suffix` fields with a dot, if they're both set, or else the empty string.
171+
"""The `domain` and `suffix` fields joined with a dot, if they're both set, or else the empty string.
172172
173173
>>> extract("http://forums.bbc.co.uk").registered_domain
174174
'bbc.co.uk'
@@ -207,11 +207,17 @@ def registered_domain(self) -> str:
207207

208208
@property
209209
def reverse_domain_name(self) -> str:
210-
"""Return the Reverse Domain Name Notation.
210+
"""The domain name in Reverse Domain Name Notation.
211211
212-
Applies a reverse domain name notation to the submitted domain, in which the
213-
registered domain is used as the leftmost component. Reverse Domain Name
214-
Notation is typically used to organize namespaces for packages and plugins.
212+
Joins extracted components of the input URL in reverse domain name
213+
notation. The suffix is used as the leftmost component, followed by the
214+
domain, then followed by the subdomain with its parts reversed.
215+
216+
Reverse Domain Name Notation is typically used to organize namespaces
217+
for packages and plugins. Technically, a full reversal would reverse
218+
the parts of the suffix, e.g. "co.uk" would become "uk.co", but this is
219+
not done in practice when Reverse Domain Name Notation is called for.
220+
So this property leaves the `suffix` part in its original order.
215221
216222
>>> extract("login.example.com").reverse_domain_name
217223
'com.example.login'
@@ -226,7 +232,7 @@ def reverse_domain_name(self) -> str:
226232

227233
@property
228234
def top_domain_under_registry_suffix(self) -> str:
229-
"""Joins the rightmost domain and `registry_suffix` with a dot, if such a domain is available and `registry_suffix` is set, or else the empty string.
235+
"""The rightmost domain and `registry_suffix` joined with a dot, if such a domain is available and `registry_suffix` is set, or else the empty string.
230236
231237
If the input was not in the Public Suffix List's private domains, this
232238
is equivalent to `top_domain_under_public_suffix`.
@@ -251,7 +257,7 @@ def top_domain_under_registry_suffix(self) -> str:
251257

252258
@property
253259
def top_domain_under_public_suffix(self) -> str:
254-
"""Joins the `domain` and `suffix` fields with a dot, if they're both set, or else the empty string.
260+
"""The `domain` and `suffix` fields joined with a dot, if they're both set, or else the empty string.
255261
256262
>>> extract("http://forums.bbc.co.uk").top_domain_under_public_suffix
257263
'bbc.co.uk'
@@ -490,9 +496,9 @@ def update(
490496

491497
@property
492498
def tlds(self, session: requests.Session | None = None) -> list[str]:
493-
"""Returns the list of tld's used by default.
499+
"""The list of TLDs used by default.
494500
495-
This will vary based on `include_psl_private_domains` and `extra_suffixes`
501+
This will vary based on `include_psl_private_domains` and `extra_suffixes`.
496502
"""
497503
return list(self._get_tld_extractor(session=session).tlds())
498504

0 commit comments

Comments
 (0)