match_class! macro

This commit is contained in:
Joey Hain
2019-04-01 13:38:06 -07:00
parent 0ce15e1ff5
commit 98889d5339
2 changed files with 93 additions and 0 deletions

View File

@@ -16,6 +16,12 @@ pub struct PyFloat {
value: f64,
}
impl PyFloat {
pub fn to_f64(&self) -> f64 {
self.value
}
}
impl PyValue for PyFloat {
fn class(vm: &VirtualMachine) -> PyClassRef {
vm.ctx.float_type()