Add bool methods - #909
Conversation
Codecov Report
@@ Coverage Diff @@
## master #909 +/- ##
==========================================
+ Coverage 64.11% 64.19% +0.08%
==========================================
Files 89 89
Lines 15342 15394 +52
Branches 3436 3446 +10
==========================================
+ Hits 9836 9882 +46
+ Misses 3224 3223 -1
- Partials 2282 2289 +7
Continue to review full report at Codecov.
|
| let rhs = get_value(rhs); | ||
| (lhs ^ rhs).into_pyobject(vm) | ||
| } else { | ||
| Ok(lhs.payload::<PyInt>().unwrap().and(rhs.clone(), vm)) |
There was a problem hiding this comment.
This should probably use .xor instead of .and?
| } | ||
| } | ||
|
|
||
| fn bool_xor(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult { |
There was a problem hiding this comment.
This method seems duplicate with the one marked by pymethod in the class. There are at this point several styles to define object methods. The latest and the way to go is to use the pymethod markers on the class. If you mark a method as such, it will be available on the object if you use PyBool::extend_class. objint.rs is a good example file where this is used.
There was a problem hiding this comment.
Okay, ignore my comment :). I was not aware that also objint.rs was modified.
|
@sapir thank you for contributing to this project. This is appreciated! I left one remark in your change. |
For #358