(zelf: PyObjectRef, args: FuncArgs, vm: &VirtualMachine)
| 1642 | #[inline] |
| 1643 | #[pyslot] |
| 1644 | fn slot_init(zelf: PyObjectRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> { |
| 1645 | #[cfg(debug_assertions)] |
| 1646 | let class_name_for_debug = zelf.class().name().to_string(); |
| 1647 | |
| 1648 | let zelf = match zelf.try_into_value(vm) { |
| 1649 | Ok(zelf) => zelf, |
| 1650 | Err(err) => { |
| 1651 | #[cfg(debug_assertions)] |
| 1652 | { |
| 1653 | if let Ok(msg) = err.as_object().repr(vm) { |
| 1654 | let double_appearance = msg |
| 1655 | .to_string_lossy() |
| 1656 | .matches(&class_name_for_debug as &str) |
| 1657 | .count() |
| 1658 | == 2; |
| 1659 | if double_appearance { |
| 1660 | panic!( |
| 1661 | "This type `{}` doesn't seem to support `init`. Override `slot_init` instead: {}", |
| 1662 | class_name_for_debug, msg |
| 1663 | ); |
| 1664 | } |
| 1665 | } |
| 1666 | } |
| 1667 | return Err(err); |
| 1668 | } |
| 1669 | }; |
| 1670 | let args: Self::Args = args.bind(vm)?; |
| 1671 | Self::init(zelf, args, vm) |
| 1672 | } |
| 1673 | |
| 1674 | fn init(zelf: PyRef<Self>, args: Self::Args, vm: &VirtualMachine) -> PyResult<()>; |
| 1675 | } |
nothing calls this directly
no test coverage detected