mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
27 lines
581 B
Rust
27 lines
581 B
Rust
use std::fmt;
|
|
|
|
use crate::pyobject::{PyContext, PyNativeFunc, PyObjectRef, PyValue};
|
|
|
|
pub struct PyBuiltinFunction {
|
|
// TODO: shouldn't be public
|
|
pub value: PyNativeFunc,
|
|
}
|
|
|
|
impl PyValue for PyBuiltinFunction {
|
|
fn required_type(ctx: &PyContext) -> PyObjectRef {
|
|
ctx.builtin_function_or_method_type()
|
|
}
|
|
}
|
|
|
|
impl fmt::Debug for PyBuiltinFunction {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(f, "builtin function")
|
|
}
|
|
}
|
|
|
|
impl PyBuiltinFunction {
|
|
pub fn new(value: PyNativeFunc) -> Self {
|
|
Self { value }
|
|
}
|
|
}
|