mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
18 lines
470 B
Rust
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()
|
|
})
|
|
}
|