Python 5.7The video for this lesson is on its way.

Everything else is ready: study the parts, the key terms and the quiz below.

  1. Part 11Problems a tool can find
  2. Part 22Formatting
  3. Part 33Linting
  4. Part 44Fixing what the linter finds
  5. Part 55Type checking
  6. Part 66Where tools mislead
  7. Part 77Recap, your challenge, and next
Python 5.7Code walkthrough7 parts

Formatting, Linting and Type Checking

Let tools find the mistakes a reader would otherwise have to find.

Loading your progress…Next: 6.1 Classes and Objects

In this lesson7 parts

  1. 01Problems a tool can find
  2. 02Formatting
  3. 03Linting
  4. 04Fixing what the linter finds
  5. 05Type checking
  6. 06Where tools mislead
  7. 07Recap, your challenge, and next

Key terms

The words this lesson introduces, each in one line. The module’s glossary collects them all.

formatter
A tool that rewrites code's layout, without changing what it does: ruff format.
linter
A tool that reads code for mistakes, without running it: ruff check.
type checker
A tool that checks every call and return against the type hints, without running the code: mypy.

Quiz 5 questions

Your first pick on each question is the one that counts, and a right one earns a coin. Getting one wrong here is how the lesson sticks.

Practice

Problems to solve in your own notebook. Each states the problem, not the steps: working out the steps is the exercise. Level A applies the lesson, B combines it with earlier ones, C stretches it.

Common mistakes

What you will see when it goes wrong, why it happens, and the fix.

Where it’s used

Where this lesson’s ideas turn up in real work.