Expression
An expression is a piece of source code that produces a value at runtime.
Related concepts: EvaluationValue
Closest Wikipedia entry: Expression (computer science)
Misconceptions about Expression51 documented Misconceptions
Check YourselfAssignCompares
= compares two values
CannotChainAttributeAccesses
Attribute accesses cannot be chained together
CannotChainAttributeToObjectInstantiation
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.
ComparisonWithBoolLiteral
To test whether an expression is True or False, one must compare it to True or to False
MapToBooleanWithTernaryOperator
To map a boolean expression to a bool, a ternary conditional operator is necessary
NoAtomicExpression
Expressions must consist of more than one piece
NoShortCircuit
and/or always evaluate both operands
NoSingleLogicAnd
& is only a bitwise AND
ObjectsMustBeNamed
A variable is needed to instantiate an object
OutsideInFunctionNesting
Nested function calls are invoked outside in
ParenthesesOnlyIfArgument
() are optional for function calls without arguments
PlusConcatenatesNumbers
The plus operator can concatenate strings and numbers
RightToLeftChaining
Chained accesses are invoked from right to left
SelfNoExpression
The name self is not an expression
StringLiteralNoObject
One needs to call str to instantiate a str object from a string literal
VariablesHoldExpressions
= stores an expression: it stores a reference to the expression in a variable