In Python, everything is an object, even the classes that create objects. You used a class to instantiate an object instance, but classes themselves are also instantiated behind the scenes. This mechanism is available to you as a programmer through the concept of metaclasses.
Metaclasses allow you to hook when classes are created, and this technique is what’s behind magical frameworks like Django and SQLAlchemy where class definitions have side effects that impact databases.
In this course you’ll learn about how:
type()
function worksMetaclasses aren’t for the faint of heart, but they do allow you to do some magic. Plus, learning about them can help you understand what exactly happens behind the scenes when you instantiate a class.
What’s Included:
Downloadable Resources:
Related Learning Paths:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4