We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3c4f04f + 81fc6f1 commit dcda3e4Copy full SHA for dcda3e4
vm/src/builtins/code.rs
@@ -262,6 +262,18 @@ impl PyRef<PyCode> {
262
vm.ctx.new_tuple(varnames)
263
}
264
265
+ #[pygetset]
266
+ pub fn co_freevars(self, vm: &VirtualMachine) -> PyTupleRef {
267
+ let names = self
268
+ .code
269
+ .freevars
270
+ .deref()
271
+ .iter()
272
+ .map(|name| name.to_pyobject(vm))
273
+ .collect();
274
+ vm.ctx.new_tuple(names)
275
+ }
276
+
277
#[pymethod]
278
pub fn replace(self, args: ReplaceArgs, vm: &VirtualMachine) -> PyResult<PyCode> {
279
let posonlyarg_count = match args.co_posonlyargcount {
0 commit comments