Python 3.12 Preview: Static Typing Improvements Quiz

Interactive Quiz ⋅ 10 Questions
By Joseph Peart

In this quiz, you’ll test your understanding of Python 3.12 Preview: Static Typing Improvements.

By working through this quiz, you’ll revisit how to declare type variables with the new syntax from PEP 695, how constrained and bounded type variables differ, and how to define type aliases with the type statement. You’ll also practice using the @override decorator to refactor safely and typed dictionaries to annotate **kwargs precisely.

This isn’t an introduction to type hints. If you’d like to review the background first, then have a look at Python Type Checking.

The quiz contains 10 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum score is 100%. Good luck!

Related Resources

Python 3.12 Preview: Static Typing Improvements

Tutorial

Python 3.12 Preview: Static Typing Improvements

In this tutorial, you'll preview the new static typing features in Python 3.12. You'll learn about the new syntax for type variables, making generics simpler to define. You'll also see how @override lets you model inheritance and how you use typed dictionaries to annotate variable keyword arguments.

advanced python