Skip to content

Commit

Permalink
Merge pull request #490 from trueagi-io/gteq
Browse files Browse the repository at this point in the history
add <= and >= to Python stdlib
  • Loading branch information
Necr0x0Der authored Nov 7, 2023
2 parents 21dbd82 + c2b523c commit 2265b1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/hyperon/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ def bool_ops():
['$t', '$t', 'Bool'], unwrap=False)
greaterAtom = OperationAtom('>', lambda a, b: a > b, ['Number', 'Number', 'Bool'])
lessAtom = OperationAtom('<', lambda a, b: a < b, ['Number', 'Number', 'Bool'])
greaterEqAtom = OperationAtom('>=', lambda a, b: a >= b, ['Number', 'Number', 'Bool'])
lessEqAtom = OperationAtom('<=', lambda a, b: a <= b, ['Number', 'Number', 'Bool'])
orAtom = OperationAtom('or', lambda a, b: a or b, ['Bool', 'Bool', 'Bool'])
andAtom = OperationAtom('and', lambda a, b: a and b, ['Bool', 'Bool', 'Bool'])
notAtom = OperationAtom('not', lambda a: not a, ['Bool', 'Bool'])
return {
r"==": equalAtom,
r"<": lessAtom,
r">": greaterAtom,
r"<=": lessEqAtom,
r">=": greaterEqAtom,
r"or": orAtom,
r"and": andAtom,
r"not": notAtom
Expand Down

0 comments on commit 2265b1d

Please sign in to comment.