ToolsSprint 5SuccessCompiled Learning ObjectivesWhy we use types (Prep)Explain how type annotations help understand a function’s expectations.Explain how type annotations help prevent bugs.Type checking with mypy (Prep)Run mypy to detect type errors in Python.Annotate function signatures with types in Python.Classes and objects (Prep)Describe the purpose of a class.Explain the relationship between a class and instances of that class.Use classes in mypy.Methods (Prep)Define a method.Define a free function.Explain why methods can be more useful than free functions.Implement a method on a class.Dataclasses (Prep)Define a value type.Use @dataclass in Python to make a value type.Customise a @dataclass in Python with extra methods.Generics (Prep)Define a generic type.Explain why generics are useful.Use a generic in a type annotation.Type-guided refactorings (Prep)Explain how type annotations and type checking can guide refactorings.Use mypy to guide a refactoring.Enums (Prep)Identify risks of using strings to represent data.Define an enum.Explain how an enum addresses the risks of using strings to represent data.Write code which checks string validity once, and then uses type-checking to avoid further validity checks.Inheritance (Prep)Define inheritance.Write a class which extends another class.Explain which method will get called when a subclass overrides some methods in superclass.Explain the difference between inheritance and composition.