mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-30 16:33:49 +00:00
[red-knot] rename module_global to global (#12385)
Per comments in https://github.com/astral-sh/ruff/pull/12269, "module global" is kind of long, and arguably redundant. I tried just using "module" but there were too many cases where I felt this was ambiguous. I like the way "global" works out better, though it does require an understanding that in Python "global" generally means "module global" not "globally global" (though in a sense module globals are also globally global since modules are singletons).
This commit is contained in:
parent
519eca9fe7
commit
181e7b3c0d
7 changed files with 82 additions and 93 deletions
|
@ -5,7 +5,7 @@ use ruff_python_ast::{Expr, ExpressionRef, StmtClassDef};
|
|||
|
||||
use crate::semantic_index::ast_ids::HasScopedAstId;
|
||||
use crate::semantic_index::semantic_index;
|
||||
use crate::types::{definition_ty, infer_scope_types, module_global_symbol_ty_by_name, Type};
|
||||
use crate::types::{definition_ty, global_symbol_ty_by_name, infer_scope_types, Type};
|
||||
use crate::Db;
|
||||
|
||||
pub struct SemanticModel<'db> {
|
||||
|
@ -28,8 +28,8 @@ impl<'db> SemanticModel<'db> {
|
|||
resolve_module(self.db.upcast(), module_name)
|
||||
}
|
||||
|
||||
pub fn module_global_symbol_ty(&self, module: &Module, symbol_name: &str) -> Type<'db> {
|
||||
module_global_symbol_ty_by_name(self.db, module.file(), symbol_name)
|
||||
pub fn global_symbol_ty(&self, module: &Module, symbol_name: &str) -> Type<'db> {
|
||||
global_symbol_ty_by_name(self.db, module.file(), symbol_name)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue