| 202 | impl Representable for PyInterpolation { |
| 203 | #[inline] |
| 204 | fn repr_wtf8(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<Wtf8Buf> { |
| 205 | let value_repr = zelf.value.repr(vm)?; |
| 206 | let expr_repr = zelf.expression.repr(vm)?; |
| 207 | let spec_repr = zelf.format_spec.repr(vm)?; |
| 208 | |
| 209 | let mut result = Wtf8Buf::from("Interpolation("); |
| 210 | result.push_wtf8(value_repr.as_wtf8()); |
| 211 | result.push_str(", "); |
| 212 | result.push_str(&expr_repr); |
| 213 | result.push_str(", "); |
| 214 | if vm.is_none(&zelf.conversion) { |
| 215 | result.push_str("None"); |
| 216 | } else { |
| 217 | result.push_wtf8(zelf.conversion.repr(vm)?.as_wtf8()); |
| 218 | } |
| 219 | result.push_str(", "); |
| 220 | result.push_str(&spec_repr); |
| 221 | result.push_char(')'); |
| 222 | |
| 223 | Ok(result) |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | pub fn init(context: &'static Context) { |