Skip to content

Commit 464d92a

Browse files
committed
Fix PySymbol
1 parent 1b6cb17 commit 464d92a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vm/src/stdlib/symtable.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ mod symtable {
174174

175175
#[pymethod]
176176
fn is_global(&self) -> bool {
177-
self.symbol.is_global()
177+
self.symbol.is_global() || (self.is_top_scope && self.symbol.is_bound())
178+
}
179+
180+
#[pymethod]
181+
fn is_declared_global(&self) -> bool {
182+
matches!(self.symbol.scope, SymbolScope::GlobalExplicit)
178183
}
179184

180185
#[pymethod]

0 commit comments

Comments
 (0)