mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
[ty] Support extending __all__
from an imported module even when the module is not an ExprName
node (#17947)
This commit is contained in:
parent
9b694ada82
commit
f51f1f7153
5 changed files with 147 additions and 31 deletions
|
@ -387,6 +387,14 @@ impl<'db> SemanticIndex<'db> {
|
|||
.copied()
|
||||
}
|
||||
|
||||
pub(crate) fn is_standalone_expression(
|
||||
&self,
|
||||
expression_key: impl Into<ExpressionNodeKey>,
|
||||
) -> bool {
|
||||
self.expressions_by_node
|
||||
.contains_key(&expression_key.into())
|
||||
}
|
||||
|
||||
/// Returns the id of the scope that `node` creates.
|
||||
/// This is different from [`definition::Definition::scope`] which
|
||||
/// returns the scope in which that definition is defined in.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue