| 433 | impl Representable for PyAttrGetter { |
| 434 | #[inline] |
| 435 | fn repr_wtf8(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<Wtf8Buf> { |
| 436 | let mut result = Wtf8Buf::from("operator.attrgetter("); |
| 437 | if let Some(_guard) = ReprGuard::enter(vm, zelf.as_object()) { |
| 438 | let mut first = true; |
| 439 | for part in &zelf.attrs { |
| 440 | if !first { |
| 441 | result.push_str(", "); |
| 442 | } |
| 443 | first = false; |
| 444 | result.push_wtf8(part.as_object().repr(vm)?.as_wtf8()); |
| 445 | } |
| 446 | } else { |
| 447 | result.push_str("..."); |
| 448 | } |
| 449 | result.push_char(')'); |
| 450 | Ok(result) |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | /// itemgetter(item, /, *items) |