Loading topic
class statement, and what happens when you call a class to get an instance. Later chapters cover initializers,5 min readclass statement. Here you will learn what happens when you call a class, why every method takes self, and which mistakes in `__i6 min read__init__ and self, and that you know how lists and dictionaries behave when two names point to the same object. It explains where an attribute is stored, how Python finds it, and why a mutable class attribute is a common bug.5 min read__init__ method. Here you will see what an instance method is, what Python does when you call one, and which mistakes come up most often.5 min read__init__ and instance methods, and that you know the difference between instance attributes and class attributes. You should also be comfortable with decorators as a syntax (@name above a function), though you do not need to write one.6 min read__init__ and instance methods, and that you know the difference between instance and class attributes. You do not need inheritance yet. You do need to be comfortable reading short Python scripts and running them in a REPL.4 min read__init__ and instance methods, and that you know the difference between instance and class attributes. You should also be comfortable with decorators as syntax: @name above a function. You don't need to know how decorators are built.5 min read__init__, and build a simple subclass that overrides a method, as covered in the inheritance chapter. You should also be comfortable with *args and **kwargs. By the end you will know what super() does, how Python orders parent classes, and h5 min read__init__ and instance methods, and that you have seen inheritance and super() from earlier chapters. Here you will learn how Python lets one piece of code work with many kinds of objects, and where that approach can fail.5 min readsuper(), and method overriding, and that you know what duck typing is. It builds on the chapters on inheritance and polymorphism.5 min read__init__, __repr__, and __eq__, and that you know the difference between instance and class attributes. It also assumes you have seen the mutable class attribute bug from earlier in this tutorial. Dataclasses automate the repetitive parts of thos4 min read__slots__ changes about how an instance stores its attributes, what it costs you, and when it is worth using. It assumes you know __init__, instance and class attributes, inheritance with super(), and basic dataclass use from the earlier chapters.5 min read