Loading topic
self refers to, and how to write an __init__ that is safe to use.2 min read__init__ and self, and that you know lists and dictionaries. It covers where an attribute is stored, how Python finds it, and why one common mistake causes shared state.2 min read__init__ method that stores attributes on self. Here you will focus on the methods that act on that stored state.2 min read__init__ and instance methods. It also assumes you know the difference between instance attributes and class attributes. Here you will learn two other kinds of method, when each fits, and the mistakes people make with them.2 min read__init__, and use instance methods and attributes. Special methods let your own classes work with print, ==, +, and other built-in syntax.2 min read__init__ and instance methods, and that you know how self stores per-instance state. If you need a refresher, review the chapters on initializers and instance methods first.3 min read__init__ and instance methods, and know how instance attributes differ from class attributes. Here you will see how one class can build on another.2 min read__init__, and override methods through basic inheritance. Here you will see what super() does, how Python decides which method to run, and where multiple inheritance goes wrong.2 min read__init__ and instance methods, and that you know how inheritance and method overriding work. Here you will see how Python lets different types be used through one interface.2 min read__init__, use inheritance and super(), and understand polymorphism and duck typing. It covers how to declare a required interface with an abstract base class (ABC), and what Python does to enforce it.2 min read__init__, know what __repr__ and __eq__ do, and understand that a mutable class attribute is shared by every instance. Earlier chapters covered all of these.2 min read__init__ and methods, subclass with super(), and know that Python looks up methods through the MRO (method resolution order). Here you learn how to decide between two ways of reusing code.2 min read__init__, instance attributes, and inheritance work. It also assumes you know that Python normally stores an instance's attributes in a dictionary.2 min read