We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
co_names
PyCode
1 parent ac25328 commit cf0ee0cCopy full SHA for cf0ee0c
vm/src/builtins/code.rs
@@ -215,6 +215,18 @@ impl PyRef<PyCode> {
215
self.code.obj_name.to_owned()
216
}
217
218
+ #[pygetset]
219
+ fn co_names(self, vm: &VirtualMachine) -> PyTupleRef {
220
+ let names = self
221
+ .code
222
+ .names
223
+ .deref()
224
+ .iter()
225
+ .map(|name| name.to_pyobject(vm))
226
+ .collect();
227
+ vm.ctx.new_tuple(names)
228
+ }
229
+
230
#[pygetset]
231
fn co_flags(self) -> u16 {
232
self.code.flags.bits()
0 commit comments