Operators
Table of Contents
Logic
and
- Logical and
- Can be chained with other
and operators (True and True and False == False)
- All elements must be
bool
or
- Logical or
- Can be chained with other
or operators (True or True or False == True)
- All elements must be
bool
not
- Logical not
- Can not be chained
- Operand must be
bool
Arithmetic
Add (+)
- Add two decimal or integer numbers, concatenate two lists, or merge two dictionaries
- Dictionary merge will replace colliding keys with the values of the second dictionary
- Will crash on sum underflow or overflow
- List concatentation will crash on list size overflow (maximum 99999 elements)
Subtract (-)
- Add two decimal or integer numbers or list subset filtering
- Will crash on difference underflow or overflow
- List subset filtering will remove all members in the first list not present in the second list
- Example:
[1, 2, None] - [None] == [1, 2]
Multiply (*)
- Multiply two decimal or integer numbers
- Will crash on product underflow or overflow
decimal numbers will round down
integer numbers will truncate down
Divide (/)
- Divide two decimal or integer numbers
- Will crash on product underflow or overflow
- Will crash on division by zero
decimal numbers will round down
integer numbers will truncate down
Exponentiation (**)
- Exponentiate a base to an exponent
decimal and integer only
- Will crash on product underflow or overflow
- Will crash on division by zero
- Maximum base is 9223372036854775807
- Maximum exponent is 9999
decimal numbers will round down
integer numbers will truncate down