PyCon 2016 in Portland, Or
hills next to breadcrumb illustration

Sunday 1:20 p.m.–4:40 p.m.

Descriptors and Metaclasses - Understanding and Using Python's More Advanced Features

Mike Müller

Audience level:
Python Core (language, stdlib, etc.)


Descriptors and metaclasses are advanced Python features. While it is possible to write Python programs without active knowledge of them, knowing more about them facilitates a deeper understanding of the language. With examples, you will learn how they work and how to write your own descriptors and metaclasses. Furthermore, you will understand when to use and when better not to use them.


This tutorial is a systematic introduction to descriptors and metaclasses. It covers all relevant information with a focus on practical applications for common tasks. In hand-on sessions you will learn how to write your own descriptors that adapt attribute access to your needs. You will experience how metaclasses can help you to get more insight into a code base. Use cases provide working code that can serve as a basis for your own solutions. You will gain a deeper understanding of more advanced concepts that can help to write better programs. I've been delivering these topics over the last years as a part of an advanced training in open and in-house courses as well as trainings at EuroPython, PyCon PL, PyCon DE and PyCon IE. The material has been continuously refined owing to the participant feedback.

Student Handout

No handouts have been provided yet for this tutorial