mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Fix is_local
This commit is contained in:
1 parent
85f65740c0
commit
9c81ce646a
2 files changed
+2
-2
No files matched your search
@@ -150,7 +150,7 @@ impl Symbol {
|
||||
}
|
||||
|
||||
pub fn is_local(&self) -> bool {
|
||||
self.scope == SymbolScope::Local
|
||||
matches!(self.scope, SymbolScope::Local | SymbolScope::Cell)
|
||||
}
|
||||
|
||||
pub fn is_bound(&self) -> bool {
|
||||
|
||||
@@ -179,7 +179,7 @@ mod symtable {
|
||||
|
||||
#[pymethod]
|
||||
fn is_local(&self) -> bool {
|
||||
self.symbol.is_local()
|
||||
self.symbol.is_local() || (self.is_top_scope && self.symbol.is_bound())
|
||||
}
|
||||
|
||||
#[pymethod]
|
||||
|
||||
Reference in new issue
Block a user