Python Knowledge Sharing Videos Online

I’ve been teaching Python in one hour knowledge sharing sessions, some of which I’ve put online on youtube.

This is the link to the playlist of the sessions:

The slides for each of the sessions, along with some example code, can be found in this github repository:

So far there are seven one-hour sessions (with more planned) on:

  • Python Core Object Model
    • Python objects
    • Slots
    • Attribute lookup and the MRO
    • Inheritance, multiple inheritance and super
    • Inside Python objects and classes
  • Closures and decorators (functional programming)
    • Functional programming: higher order functions and functions as objects
    • Lambdas
    • Closures: functions that build functions
    • Variable scoping: global, local and nonlocal
    • Decorators: functions wrapping functions
    • Decorator factories (decorators that take arguments)
    • Class decorators
    • Decorator order and using functools.wraps
  • Generators and Iterators
    • The iteration protocol
    • Stateful iteration with generators
    • Adding iteration support to objects
    • References, assignment and mutability
    • Identity versus equality
    • Call by object
    • Object copying
  • Unicode, Floats and regex
    • Floating point numbers
    • Unicode, encodings and strings
    • Regular expressions
  • Concurrency (async, threads, processes, the GIL)
    • The history of concurrency from AmigaOS to a multi-core world
    • Python and the Global Interpreter Lock
    • I/O bound and CPU bound tasks
    • Threads and processes
    • Async programming (green threading, coroutines)
    • Concurrency with threads
    • Concurrency with multiprocessing
    • Looking to the future (Python 3.13): optional GIL (PEP 703) and subinterpreters (PEP 554)
  • Testing with pytest
    • virtual environments and pipenv (installing pytest)
    • pytest command line for collecting and running tests
    • Simple test functions and asserts
    • Test fixtures and conftest.py
    • Testing exceptions
    • Test parameterisation for test combinations
    • Test marking for running test subsets
    • Principles of testing (unit tests versus end to end testing, building test helpers etc)
    • Mocking and patching
  • Modules and Namespaces
    • Import syntax variations
    • namespaces and variable lookups
    • sys.modules and the import cache
    • Module objects
    • Module level functionality: __dir__ and __getattr__
    • Packages and the filesystem
    • Relative import syntax
    • Module reloading (how to do it and why not to do it)
    • Circular imports, avoiding and fixing
    • Executable modules and packages

Other Talks

A selection of some of the talks and interviews I’ve given on Python and software engineering across my career.

Written on November 4, 2024