We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d690b2d commit e6ea143Copy full SHA for e6ea143
1 file changed
crates/stdlib/src/gc.rs
@@ -2,7 +2,15 @@ pub(crate) use gc::make_module;
2
3
#[pymodule]
4
mod gc {
5
- use crate::vm::{PyResult, VirtualMachine, function::FuncArgs};
+ use crate::vm::{PyObjectRef, PyResult, VirtualMachine, function::FuncArgs};
6
+
7
+ /// A list of objects which the collector found to be unreachable
8
+ /// but could not be freed. RustPython doesn't have cyclic GC,
9
+ /// so this is always an empty list.
10
+ #[pyattr]
11
+ fn garbage(vm: &VirtualMachine) -> PyObjectRef {
12
+ vm.ctx.new_list(vec![]).into()
13
+ }
14
15
#[pyfunction]
16
fn collect(_args: FuncArgs, _vm: &VirtualMachine) -> i32 {
0 commit comments