None matches everything; plain strings do exact comparison; regex objects use .match().
(obj: &PyObject, arg: &PyObject, vm: &VirtualMachine)
| 100 | /// None matches everything; plain strings do exact comparison; |
| 101 | /// regex objects use .match(). |
| 102 | fn check_matched(obj: &PyObject, arg: &PyObject, vm: &VirtualMachine) -> PyResult<bool> { |
| 103 | if vm.is_none(obj) { |
| 104 | return Ok(true); |
| 105 | } |
| 106 | if obj.class().is(vm.ctx.types.str_type) { |
| 107 | return obj.rich_compare_bool(arg, crate::types::PyComparisonOp::Eq, vm); |
| 108 | } |
| 109 | let result = vm.call_method(obj, "match", (arg.to_owned(),))?; |
| 110 | result.is_true(vm) |
| 111 | } |
| 112 | |
| 113 | fn get_warnings_attr( |
| 114 | vm: &VirtualMachine, |
no test coverage detected