This is the website for an older EuroPython. Looking for the latest EuroPython? Click here!
Skip to main content

Practical introduction to descriptors

Level:
intermediate
Room:
club b
Start:
Duration:
90 minutes

Abstract

Descriptors are not black magic and this practical tutorial will show you that. In fact, you use descriptors every day and you don't even know it!

Through a series of practical, hands-on exercises, you will learn

  • how to create a descriptor;
  • how to use the dunder methods __get__, __set__, and __set_name__;
  • what the descriptor protocol is; and
  • where descriptors show up in day-to-day Python code.
TutorialPython Internals & Ecosystem

Description

The expected Python level for participants is “intermediate”. In practice, if you are comfortable with using the built-in property and if you have used dunder methods before, you should be fine.

This tutorial is based off of an article I wrote about descriptors.

All materials can be accessed from this GH repo.


The speaker

Rodrigo Girão Serrão

Rodrigo Girão Serrão

Rodrigo has always been fascinated by problem solving and that is why he picked up programming – so that he could solve more problems. He also loves sharing knowledge, and that is why he spends so much time writing articles in his blog mathspp.com/blog, writing on Twitter @mathsppblog, and giving workshops and courses.

His main areas of scientific interest are mathematics (numerical analysis in particular) and programming in general (with a preference for the Python and APL languages), but Rodrigo also enjoys reading fantasy books, watching silly comedy movies and eating chocolate.

All materials can be accessed from this GH repo.


← Back to schedule