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 type-var error, in newer versions of mypy #275

Closed john-kurkowski closed 1 year ago

john-kurkowski commented 1 year ago

mypy complains that get should be generic in order to return a generic. The method is in fact dynamic: the cache can contain multiple types. The caller must cast to the type it thinks it is get-ing.