(self, vm: &VirtualMachine)
| 32 | } |
| 33 | |
| 34 | pub fn bytes(self, vm: &VirtualMachine) -> PyResult { |
| 35 | let bytes_type = vm.ctx.types.bytes_type; |
| 36 | match self.downcast_exact::<PyInt>(vm) { |
| 37 | Ok(int) => Err(vm.new_downcast_type_error(bytes_type, &int)), |
| 38 | Err(obj) => { |
| 39 | let args = FuncArgs::from(vec![obj]); |
| 40 | <PyBytes as Constructor>::slot_new(bytes_type.to_owned(), args, vm) |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // const hash_not_implemented: fn(&PyObject, &VirtualMachine) ->PyResult<PyHash> = crate::types::Unhashable::slot_hash; |
| 46 |
no test coverage detected