Enum python_ast::scope::Scope
source · pub enum Scope {
None,
Local(HashMap<String, Symbol>),
Global(HashMap<String, Symbol>),
}
Expand description
Python uses LEGB scope: Local, Enclosing, Global, and Built-in. Local scope consists of local variables inside a function. Names in the local scope may change new declarations overwrite older ones. Enclosing scope is the scope of a containing function with inner/nested functions. Global is the global scope. Names within the global namespace must be unique. Built-in is basically a special scope for elements that are built into Python.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more