Reaching the next level of abstraction: meta classes and what they enable

Valentin Zieglmeier

Python Language & Ecosystem
Python Skill Advanced
Domain Expertise None

Python is accessible and easy, but what makes it especially fun and powerful are its deep meta programming capabilities. One salient example are meta classes, which allow us to deeply hook into the class creation process. But, they seem quite complex at first glance, which may have deterred you so far from exploring them. In my talk, I want to alleviate your uncertainty and give you concrete examples of how meta classes work and what they enable you to do. We will look at using them to customize class creation, ensure data integrity by adding custom validators, or defining custom syntactic sugar that reduces boilerplate.

Outline:

  • Programming and meta programming
  • Everything is an object
  • Higher-order functions
  • Meta class basics: customizing class creation and enforcing constraints
  • Advanced example: custom syntactic sugar
  • With great power comes great responsibility

Valentin Zieglmeier

I work as a software consultant at TNG Technology Consulting. Previously, I completed a doctorate (Dr. rer. nat.) in Computer Science at the Technical University of Munich (TUM) in the area of software engineering where I taught a course on advanced Python programming.