(
&self,
other: &Self,
key: &K,
vm: &VirtualMachine,
)
| 746 | } |
| 747 | |
| 748 | pub fn get_chain<K: DictKey + ?Sized>( |
| 749 | &self, |
| 750 | other: &Self, |
| 751 | key: &K, |
| 752 | vm: &VirtualMachine, |
| 753 | ) -> PyResult<Option<PyObjectRef>> { |
| 754 | let self_exact = self.exact_dict(vm); |
| 755 | let other_exact = other.exact_dict(vm); |
| 756 | if self_exact && other_exact { |
| 757 | // SAFETY: exact_dict checks passed |
| 758 | let self_exact = unsafe { PyExact::ref_unchecked(self) }; |
| 759 | let other_exact = unsafe { PyExact::ref_unchecked(other) }; |
| 760 | self_exact.get_chain_exact(other_exact, key, vm) |
| 761 | } else if let Some(value) = self.get_item_opt(key, vm)? { |
| 762 | Ok(Some(value)) |
| 763 | } else { |
| 764 | other.get_item_opt(key, vm) |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | impl PyExact<PyDict> { |
no test coverage detected