(&self, vm: &VirtualMachine)
| 1136 | |
| 1137 | #[pymethod] |
| 1138 | fn read_byte(&self, vm: &VirtualMachine) -> PyResult<PyIntRef> { |
| 1139 | let pos = self.pos(); |
| 1140 | if pos >= self.__len__() { |
| 1141 | return Err(vm.new_value_error("read byte out of range")); |
| 1142 | } |
| 1143 | |
| 1144 | let b = self.check_valid(vm)?.deref().as_ref().unwrap().as_slice()[pos]; |
| 1145 | |
| 1146 | self.advance_pos(1); |
| 1147 | |
| 1148 | Ok(PyInt::from(b).into_ref(&vm.ctx)) |
| 1149 | } |
| 1150 | |
| 1151 | #[pymethod] |
| 1152 | fn readline(&self, vm: &VirtualMachine) -> PyResult<PyBytesRef> { |