Loading topic
type, the object that creates classes. Every later chapter builds on that idea.2 min read__init__ and instance attributes are. The previous chapter showed that a class is an object. Here you build one by calling type directly.3 min readsuper(), write simple decorators, and pass **kwargs. It also assumes you know that type(name, bases, namespace) builds a class, which the previous chapter covered. Here you will see that a class statement is a sequence of 3 min readsuper(), and use **kwargs. You do not need to know metaclasses yet.2 min readsuper(), and use **kwargs. You should also have read the previous chapter on __init_subclass__.2 min read__get__ and __set__), how a class statement defines attributes, and the basics of super(). You don't need metaclasses yet.3 min read__init_subclass__ and __set_name__ in the earlier chapters. A class decorator is the simplest way to change a class after Python has built it, and it needs no metaclass.2 min readsuper(), use decorators, and pass **kwargs. It also assumes you have seen that type(name, bases, namespace) builds a class. Here you will write a metaclass that hooks into that step.2 min readtype passed with metaclass=) and that you know how super() and **kwargs work. Here you will see what each of the three methods does, when it runs, and which one fits which job.2 min read__new__. It also assumes you know that a class body is ordinary code that runs once.3 min readtype) and pass metaclass= in a class line. It also assumes you know how super() works in multiple inheritance. Here you learn how Python decides which metaclass builds a class, and what to do when it cannot decide.2 min readsuper(), use decorators, and pass **kwargs. It also assumes you have seen __init_subclass__, __set_name__ and a basic metaclass in earlier chapters. Here you will learn how to pick the lightest of the three tools for a given j3 min read