john-kurkowski / tldextract

Accurately separates a URL’s subdomain, domain, and public suffix, using the Public Suffix List (PSL).
BSD 3-Clause "New" or "Revised" License
1.81k stars 211 forks source link

Fix pyright not finding tldextract public interface #279

Closed agateau-gg closed 1 year ago

agateau-gg commented 1 year ago

When I run pyright against this code (inspired from the README):

import tldextract

print(tldextract.extract('http://forums.news.cnn.com/'))

it complains like this:

pyright 1.1.291
/home/agateau/tmp/tst.py
  /home/agateau/tmp/tst.py:3:18 - error: "extract" is not exported from module "tldextract" (reportPrivateImportUsage)

Listing all symbols in __all__ fixes the problem.

john-kurkowski commented 1 year ago

Nice! I was in this file recently trying out Ruff. It was complaining about the file's unused imports. Anyway, explicit is better than implicit. Thank you!