mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
17 lines
457 B
Rust
17 lines
457 B
Rust
// use std::rc::Rc;
|
|
// use std::cell::RefCell;
|
|
|
|
/*
|
|
* The magical type type
|
|
*/
|
|
|
|
use super::pyobject::{PyObject, PyObjectKind, PyObjectRef};
|
|
|
|
pub fn create_type() -> PyObjectRef {
|
|
let typ = PyObject::default().into_ref();
|
|
(*typ.borrow_mut()).kind = PyObjectKind::Type;
|
|
(*typ.borrow_mut()).typ = Some(typ.clone());
|
|
// typ.borrow_mut().dict.insert("__str__".to_string(), PyObject::new(PyObjectKind::RustFunction { function: str }));
|
|
typ
|
|
}
|