(&self, obj: PyObjectRef)
| 101 | obj.is(&self.ctx.none) |
| 102 | } |
| 103 | pub fn option_if_none(&self, obj: PyObjectRef) -> Option<PyObjectRef> { |
| 104 | if self.is_none(&obj) { None } else { Some(obj) } |
| 105 | } |
| 106 | pub fn unwrap_or_none(&self, obj: Option<PyObjectRef>) -> PyObjectRef { |
| 107 | obj.unwrap_or_else(|| self.ctx.none()) |
| 108 | } |