The Magic of Self: How Python inserts self into methods by Sebastiaan Zeeff | PyConSe | 2025

PyCon Sweden
149 views •

Chances are that you’ve noticed that Python magically inserts “self” into methods for you. What you might not know is that the power behind this magic is the well-defined descriptor protocol. In fact, descriptors power many of the magical things in Python, from simple properties to lazy-loading attributes on database models. In this talk, I will explain the magic of self by introducing you to the descriptor protocol. I will show you how this protocol powers the insertion of self and what else you can do with it. By the end, you will have a solid understanding of descriptors and know enough to start implementing descriptors of your own. #pyconse #pyconse2025 #stockholm

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close