Skip to content

Broken boolean overrides #2

Description

@dromaiidae

Boolean operator overrides are parsed incorrectly; currently you have to explicitly construct an And object to use it

Here's an example unittest to see this

def test_bool_override(self):
    from teg.lang.integrable_program import And
    x = Var('x', 0)
    a = And(1 < x, x < 2)
    b = 1 < x and x < 2
    c = 1 < x < 2
    print(f'{a}:\t{evaluate(a)}')
    print(f'{b}:\t{evaluate(b)}')
    print(f'{c}:\t{evaluate(c)}')
    self.assertEqual(a, b)
    self.assertEqual(a, c)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions