We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7c3f85 commit da57730Copy full SHA for da57730
tests/snippets/builtin_locals.py
@@ -0,0 +1,8 @@
1
+
2
+a = 5
3
+b = 6
4
5
+loc = locals()
6
7
+assert loc['a'] == 5
8
+assert loc['b'] == 6
vm/src/vm.rs
@@ -208,16 +208,8 @@ impl VirtualMachine {
208
}
209
210
pub fn get_locals(&self) -> PyObjectRef {
211
- // let scope = &self.frames.last().unwrap().locals;
212
- // scope.clone()
213
- // TODO: fix this!
214
- self.get_none()
215
- /*
216
- match (*scope).payload {
217
- PyObjectPayload::Scope { scope } => { scope.locals.clone() },
218
- _ => { panic!("Should be scope") },
219
- } // .clone()
220
- */
+ let scope = self.current_scope();
+ scope.locals.clone()
221
222
223
pub fn context(&self) -> &PyContext {
0 commit comments