crawlee-python icon indicating copy to clipboard operation
crawlee-python copied to clipboard

pylance reportPrivateImportUsage

Open zigai opened this issue 7 months ago • 2 comments

When using VS Code, pylance (v2024.7.1, latest) frequently reports reportPrivateImportUsage errors when importing classes. image

These errors can be fixed by defining a __all__ list in the module's __init__.py file, which explicitly declares the public names for the module.

Here's an example for the http_crawler module:

from .http_crawler import HttpCrawler
from .types import HttpCrawlingContext, HttpCrawlingResult

__all__ = ["HttpCrawler", "HttpCrawlingContext", "HttpCrawlingResult"]

zigai avatar Jul 09 '24 15:07 zigai