Skip to content

Fix AND/OR crashing with a non-Expression other - #134

Open
SAY-5 wants to merge 1 commit into
bastikr:masterfrom
SAY-5:fix-and-or-nonexpression-typeerror
Open

SAY-5 wants to merge 1 commit into
bastikr:masterfrom
SAY-5:fix-and-or-nonexpression-typeerror

Conversation

@SAY-5

@SAY-5 SAY-5 commented Aug 25, 2026

Copy link
Copy Markdown

Combining an AND or OR expression with something that isn't an Expression (a plain string, for example) crashes inside the constructor instead of raising a clean TypeError. __and__/__or__ now return NotImplemented for non-Expression operands so Python falls back to the normal unsupported-operand TypeError, same as __mul__/__add__ which are aliased to them. Fixes #130.

…on-Expression

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AND.__add__() raises AttributeError when other is passed as a string

1 participant