Implemented lt, gt, le, ge

This commit is contained in:
dmitrijoseph
2019-07-14 18:47:45 -04:00
parent fb3ccadc17
commit eba282dcbe
2 changed files with 40 additions and 0 deletions

View File

@@ -245,6 +245,26 @@ impl PyRange {
}
}
#[pymethod(name = "__lt__")]
fn lt(&self, _rhs: PyObjectRef, vm: &VirtualMachine) -> PyResult {
Ok(vm.ctx.not_implemented())
}
#[pymethod(name = "__gt__")]
fn gt(&self, _rhs: PyObjectRef, vm: &VirtualMachine) -> PyResult {
Ok(vm.ctx.not_implemented())
}
#[pymethod(name = "__ge__")]
fn ge(&self, _rhs: PyObjectRef, vm:&VirtualMachine) -> PyResult {
Ok(vm.ctx.not_implemented())
}
#[pymethod(name = "__le__")]
fn le(&self, _rhs: PyObjectRef, vm: &VirtualMachine) -> PyResult {
Ok(vm.ctx.not_implemented())
}
#[pymethod(name = "index")]
fn index(&self, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyInt> {
if let Ok(int) = needle.downcast::<PyInt>() {