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.
1 parent 1fd557d commit 07f4218Copy full SHA for 07f4218
vm/src/builtins/code.rs
@@ -262,6 +262,17 @@ 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.code
268
+ .freevars
269
+ .deref()
270
+ .iter()
271
+ .map(|name| name.to_pyobject(vm))
272
+ .collect();
273
+ vm.ctx.new_tuple(names)
274
+ }
275
+
276
#[pymethod]
277
pub fn replace(self, args: ReplaceArgs, vm: &VirtualMachine) -> PyResult<PyCode> {
278
let posonlyarg_count = match args.co_posonlyargcount {
0 commit comments