ToolsSprint 5SuccessCompiled Learning ObjectivesWhy we use types PrepExplain how type annotations help understand a function’s expectations.Explain how type annotations help prevent bugs.Type checking with mypy PrepRun mypy to detect type errors in Python.Annotate function signatures with types in Python.Classes and objects PrepDescribe the purpose of a class.Explain the relationship between a class and instances of that class.Use classes in mypy.Methods PrepDefine a method.Define a free function.Explain why methods can be more useful than free functions.Implement a method on a class.Dataclasses PrepDefine a value type.Use @dataclass in Python to make a value type.Customise a @dataclass in Python with extra methods.Generics PrepDefine a generic type.Explain why generics are useful.Use a generic in a type annotation.Type-guided refactorings PrepExplain how type annotations and type checking can guide refactorings.Use mypy to guide a refactoring.Enums PrepIdentify 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 PrepDefine 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.