(
arg: OptionalArg<PyObjectRef>,
vm: &VirtualMachine,
)
| 701 | Option<PyObjectRef>, |
| 702 | )> { |
| 703 | fn into_option( |
| 704 | arg: OptionalArg<PyObjectRef>, |
| 705 | vm: &VirtualMachine, |
| 706 | ) -> PyResult<Option<PyObjectRef>> { |
| 707 | match arg { |
| 708 | OptionalArg::Present(obj) => { |
| 709 | if !obj.is_callable() { |
| 710 | return Err(vm.new_type_error("Args must be callable")); |
| 711 | } |
| 712 | Ok(Some(obj)) |
| 713 | } |
| 714 | OptionalArg::Missing => Ok(None), |
| 715 | } |
| 716 | } |
| 717 | let before = into_option(self.before, vm)?; |
| 718 | let after_in_parent = into_option(self.after_in_parent, vm)?; |
| 719 | let after_in_child = into_option(self.after_in_child, vm)?; |
no test coverage detected