Files
RustPython/vm/src/stdlib/weakref.rs

18 lines
470 B
Rust

//! Implementation in line with the python `weakref` module.
//!
//! See also:
//! - [python weakref module](https://docs.python.org/3/library/weakref.html)
//! - [rust weak struct](https://doc.rust-lang.org/std/rc/struct.Weak.html)
//!
use super::super::pyobject::PyObjectRef;
use crate::vm::VirtualMachine;
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
let ctx = &vm.ctx;
py_module!(vm, "_weakref", {
"ref" => ctx.weakref_type()
})
}