PyAI Learn Türkçe

Module 31

Robust Python

Side path (after Module 11): type hints, dataclass, regular expressions, logging, tests

When you finish this module you can say:

I can write code with type hints, dataclasses, regular expressions and logging, protect it with tests, and turn it into a small multi-file library.

By the end of this module you will be able to write a small Python library with type hints, a dataclass, regular-expression parsing, logging and tests.

Start

Lessons

6 lessons · ≈ 60 min

  1. Type hints8 min
  2. dataclass10 min
  3. Regular expressions (re)10 min
  4. Logging10 min
  5. Writing tests10 min
  6. Project: a small library12 min · project

Practice exercises

Short writing exercises, independent of the lessons: Go to the exercises

  1. Shopping cart
  2. Hour and level from a log line
  3. Record the invalid ages