binary 'and' and 'or' operators support
Bug #187047 reported by
Thomas Herve
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
I have a need for binary 'and' operator to match IP addresses stored in a database. The attached branch implements both operators, with tests. Please review.
Changed in storm: | |
assignee: | nobody → guanlonghuang (jace833) |
status: | New → Confirmed |
status: | Confirmed → Fix Committed |
Changed in storm: | |
status: | Fix Committed → New |
assignee: | guanlonghuang (jace833) → nobody |
To post a comment you must log in.
Overall, the patch looks okay to me. A few comments:
* I wonder if Comparable. __and__ () and __or__() doing boolean and/or will be confusing? docs.python. org/ref/ bitwise. html
* Would BitwiseAnd and BitwiseOr be better names? That seems to be the names for the operators used here:
http://
* Would it be worth rounding out the remaining bitwise operators? While and/or seem fairly consistently implemented, the others don't so might require per-backend compilation (e.g. xor is "^" in mysql and "#" in postgresql).