(&self, vm: &VirtualMachine)
| 267 | } |
| 268 | |
| 269 | pub fn repr_bytes(&self, vm: &VirtualMachine) -> PyResult<String> { |
| 270 | let escape = crate::literal::escape::AsciiEscape::new_repr(&self.elements); |
| 271 | let len = 3 + escape |
| 272 | .layout() |
| 273 | .len |
| 274 | .ok_or_else(|| Self::new_repr_overflow_error(vm))?; |
| 275 | let mut buf = String::with_capacity(len); |
| 276 | escape.bytes_repr().write(&mut buf).unwrap(); |
| 277 | debug_assert_eq!(buf.len(), len); |
| 278 | Ok(buf) |
| 279 | } |
| 280 | |
| 281 | #[inline] |
| 282 | pub const fn len(&self) -> usize { |
no test coverage detected