Method
__subclasscheck__
(
zelf: PyRef<Self>,
obj: PyObjectRef,
vm: &VirtualMachine,
)
Source from the content-addressed store, hash-verified
| 146 | |
| 147 | #[pymethod] |
| 148 | fn __subclasscheck__( |
| 149 | zelf: PyRef<Self>, |
| 150 | obj: PyObjectRef, |
| 151 | vm: &VirtualMachine, |
| 152 | ) -> PyResult<bool> { |
| 153 | if zelf |
| 154 | .args |
| 155 | .iter() |
| 156 | .any(|x| x.class().is(vm.ctx.types.generic_alias_type)) |
| 157 | { |
| 158 | Err(vm.new_type_error("issubclass() argument 2 cannot be a parameterized generic")) |
| 159 | } else { |
| 160 | obj.is_subclass(zelf.__args__().as_object(), vm) |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | fn __or__(zelf: PyObjectRef, other: PyObjectRef, vm: &VirtualMachine) -> PyResult { |
| 165 | type_::or_(zelf, other, vm) |
Callers
nothing calls this directly
Tested by
no test coverage detected