Prefer `VirtualMachine.is_none` method
@@ -41,7 +41,7 @@ impl PyUnion {
#[pymethod(magic)]
fn repr(&self, vm: &VirtualMachine) -> PyResult<String> {
fn repr_item(obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<String> {
- if obj.is(&vm.ctx.types.none_type) {
+ if vm.is_none(&obj) {
return Ok("None".to_string());
}
