Leonardo Rochael Almeida
Python developer with over 22 years of experience, Leonardo is a technical reviewer for Luciano Ramalho's "Fluent Python" book for both editions.
LeoRochael
Github – LinkedIn –Session
Metaclasses. What are they? Where do they live? How do they reproduce?
Did you know that you can make your classes receive keyword arguments, just like functions? And that they can be decorated as well?
Do you want to understand how classes, metaclasses and decorators work and what are they good for?
In this hands-on coding session we will inspect the inner workings of how Python creates classes, and how decorators, meta-classes and methods from superclasses can influence this process.
We'll explore:
- normal and special methods
- how attribute lookup works between instances and classes
- what are descriptors, and how they fit into attribute lookup process
- what is the relationship between instances, classes and metaclasses
- what are metaclasses for
- and some other metaprogramming odds and ends
All that is required for you to enjoy this session is that you have written a class in Python. If you've done the original Python Tutorial, that should be more than enough.