Strange reportPrivateImportUsage Error #9260
-
Not sure if this behavior is expected, but getting Pylance However, removing the parenthesis around the Concretely, updating this: from robot.parsing import (get_tokens, get_resource_tokens, get_init_tokens,
get_model, get_resource_model, get_init_model, Token) to from robot.parsing import get_tokens, get_resource_tokens, get_init_tokens, get_model, get_resource_model, get_init_model, removes the error. Any ideas why this is?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You didn't provide the name of the package or the version that you've installed. I'm guessing that it's robotframework 7.1.1? I'm not able to repro the problem as reported, so there must be additional steps required for a repro. Here's what I see when using the latest version of Pylance. |
Beta Was this translation helpful? Give feedback.
This package is a "py.typed" library, which means standard-compliant type checkers like pyright follow these rules when determining whether a symbol is public or private.
In this case, the
get_model
symbol is not publicly exported from therobot.api.parsing
submodule. If the library authors had intended for it to be publicly exported from this submodule, they would have needed to use a redundant import form (from robot.parsing import get_model as get_model
) or include "get_model" in an__all__
definition.I'm not able to reproduce a change in behavior by removing parentheses around the imports in
robot.api.__init__.py
. I agree that the presence or absence of parens should not affect this …