Repository: john-kurkowski/tldextract

Issue:
Suffix detection broken for private `uk.com` suffix in version 3.4.3
I _think_ the trie suffix detection in #285 in version 3.4.3 might have broken looking up `uk.com` private suffix (which is included in the bundled snapshot)
https://github.com/john-kurkowski/tldextract/blob/6f45fed6c56f377e8a9a77ce43c50712281940d8/tldextract/.tld_set_snapshot#L10570

Comparing 3.4.2:
```python
>>> import tldextract
>>> tldextract.__version__
'3.4.2'
>>> extractor = tldextract.TLDExtract(include_psl_private_domains=True)
>>> extractor("foo.uk.com")
ExtractResult(subdomain='', domain='foo', suffix='uk.com')
```

to 3.4.3:
```python
>>> import tldextract
>>> tldextract.__version__
'3.4.3'
>>> extractor = tldextract.TLDExtract(include_psl_private_domains=True)
>>> extractor("foo.uk.com")
ExtractResult(subdomain='foo', domain='uk', suffix='com')
```

you can see that the `uk.com` suffix is no longer recognized but instead thinks `uk` is the domain.

Although weirdly just using the `tldextract.extract` wrapper function in both versions give the exact same (correct) results
```python
>>> import tldextract
>>> tldextract.extract("foo.uk.com", include_psl_private_domains=True)
ExtractResult(subdomain='', domain='foo', suffix='uk.com')
```

Discussion:

Patch:
diff --git a/tldextract/tldextract.py b/tldextract/tldextract.py
index ea20f02..1303dd8 100644
--- a/tldextract/tldextract.py
+++ b/tldextract/tldextract.py
@@ -411,6 +411,9 @@ class _PublicSuffixListTLDExtractor:
 
         Returns len(spl) if no suffix is found.
         """
+        if include_psl_private_domains is None:
+            include_psl_private_domains = self.include_psl_private_domains
+
         node = (
             self.tlds_incl_private_trie
             if include_psl_private_domains


Test patch:
diff --git a/tests/main_test.py b/tests/main_test.py
index 9d24344..c96a7f5 100644
--- a/tests/main_test.py
+++ b/tests/main_test.py
@@ -384,6 +384,17 @@ def test_cache_timeouts(tmpdir):
         tldextract.suffix_list.find_first_response(cache, [server], 5)
 
 
+def test_include_psl_private_domain_attr():
+    extract_private = tldextract.TLDExtract(include_psl_private_domains=True)
+    extract_public = tldextract.TLDExtract(include_psl_private_domains=False)
+    assert extract_private("foo.uk.com") == ExtractResult(
+        subdomain="", domain="foo", suffix="uk.com"
+    )
+    assert extract_public("foo.uk.com") == ExtractResult(
+        subdomain="foo", domain="uk", suffix="com"
+    )
+
+
 def test_tlds_property():
     extract_private = tldextract.TLDExtract(
         cache_dir=None, suffix_list_urls=(), include_psl_private_domains=True