REFERENCE LISTS AND TABLES

In this Appendix I’ve detailed some reference lists and tables you may find useful.

ORDER OF OPERATOR PRECEDENCE

From lowest to highest. (Source: https://docs.python.org/3/reference/expressions.html
#operator-precedence
)

Table A.1 Order of operator precedence

Operator

Description

lambda

Lambda expression

if – else

Conditional expression

or

Boolean OR

and

Boolean AND

not x

Boolean NOT

in, not in, is, is not, <, <=, >, >=, !=, ==

Comparisons, including membership tests and identity tests

|

Bitwise OR

^

Bitwise XOR

&

Bitwise AND

<<, >>

Shifts

+, -

Addition and subtraction

*, @, /, //, %

Multiplication, matrix multiplication, division, remainder

+x, -x, ~x

Positive, negative, bitwise NOT

**

Exponentiation

await x

Await expression

x[], x[:], x(…), x.attribute

Subscription, slicing, call, attribute reference

(…), […], {x: y}, {…}

Binding or tuple display, list display, dictionary display, set display

USABILITY HEURISTICS

These heuristics, described by Jakob Nielsen (a leading expert on usability), form general principles for designing interactive systems. See the original article for more explanation (Nielsen, 1995).

  • System status should be visible at all times.
  • The system should use words, phrases and concepts that are familiar to the user.
  • Give users a clearly marked ‘emergency exit’. Support undo and redo.
  • Users should not have to wonder whether different words, situations or actions mean the same thing.
  • Prefer prevention of errors to showing error messages.
  • Prefer recognition rather than recall. Minimise the user’s memory load.
  • Provide shortcuts for advanced users.
  • Use an aesthetic and minimalist design.
  • Use plain language in error messages and suggest solutions.
  • Provide help documentation.

MUTABLE AND IMMUTABLE TYPES IN PYTHON

Table A.2 Some examples of immutable and mutable types in Python

Immutable types

Mutable types

Number

Dictionary

String

Byte array

Tuple

List

Frozen set

Set