Function of operators in question:
- Slice in list context returns the specified elements.
- Slice in scalar context returns the last of the specified element.
- List assignment in list context returns its LHS.
- List assignment in scalar context returns the number of elements assigned.
- Scalar assignment in any context returns its LHS.
Applying precedence and associativity, we get:
- Right-most slice (in list context) returns the specified elements.
- Left-most slice (in list context) returns the specified elements.
- List assignment (in scalar context) returns the number of elements assigned.
- Scalar assignment (in list context) returns its LHS.
|