Switching to Python from another language

You don't need to learn what a loop is again: you need to unlearn a few habits. We go fast on the basics, and slow down on what surprises newcomers: variables, mutability, duck typing, iteration. Every idiom is compared with the way you would write it in your language.

Duration: 3 days · Level: intermediate

For: experienced developers coming from Java, JavaScript, PHP, C#, C++ or another language.

Prerequisites: being comfortable in at least one programming language.

Switching to Python from another language

Day 1 — The language, fast

  • Installing Python: good practices, and uv
  • The interpreter, ipython and the REPL workflow
  • Basic types, and what None, True and False really are
  • Every object is truthy or falsy
  • Indentation, conditions and loops
  • While: an if that repeats itself
  • Lists, tuples, dicts and sets
  • Strings and f-strings
  • Reading an error message and the stack trace
  • Exceptions: ask forgiveness, not permission

Day 2 — Thinking in Python

  • What makes Python variables special
  • Don't get caught out by mutability
  • Saving time with unpacking
  • Functions, default values and keyword arguments
  • Flexible APIs with *args and **kwargs
  • Comprehensions instead of map and filter
  • The iteration toolbox: enumerate, zip, itertools
  • Lazy evaluation with generators
  • Context managers and with
  • Modules, imports and packages

Day 3 — What not to bring along

  • Classes without the ceremony
  • Getters and setters: not so useful in Python
  • Properties instead of accessors
  • Duck typing and protocols
  • Composition vs inheritance
  • Dunder methods: making your objects feel native
  • Dataclasses and Pydantic
  • Type hints, checked with mypy
  • The ecosystem: uv, ruff, pytest
  • Where Python is slow, and what to do about it

Elevate Your Python Proficiency!