According to the README, the suffix_list_urls can be set to None to prevent live HTTP fetching:
# extract callable that falls back to the included TLD snapshot, no live HTTP fetching
no_fetch_extract = tldextract.TLDExtract(suffix_list_urls=None)
The TLDExtract constructor then handles None by setting the value to an empty tuple like this:
suffix_list_urls = suffix_list_urls or ()
However, my IDE complains about me using None as value for suffix_list_urls since it is not Optional. A workaround is using an empty tuple as a value myself, but I don't think I should have to.
According to the README, the
suffix_list_urls
can be set toNone
to prevent live HTTP fetching:The
TLDExtract
constructor then handlesNone
by setting the value to an empty tuple like this:However, my IDE complains about me using
None
as value forsuffix_list_urls
since it is notOptional
. A workaround is using an empty tuple as a value myself, but I don't think I should have to.