[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

Shreyan Avigyan report at bugs.python.org
Tue Apr 13 15:50:18 EDT 2021


Shreyan Avigyan <shreyan.avigyan at gmail.com> added the comment:

Hi. I'm totally confused about other keywords but I'm a little concerned about the "and", "or" operator when used on, not only "int" (also known as "long") but also most Python objects other then bool type.

Mostly when used on Python built-in objects "and", "or" keyword returns a very peculiar result. The "and" keyword returns the Python object on the left hand side while "or" returns the Python object on the right hand side. This applies to all Python object, built-in or user-defined, unless it has a specific __and__ or __or__ method defined. 

What is actually going on?

----------
nosy: +shreyanavigyan

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43833>
_______________________________________


More information about the Python-bugs-list mailing list