Full Stack FastAPI, React, and MongoDB - Second Edition
by Marko Aleksendrić, Shrey Batra, Rachelle Palmer, Shubham Ranjan
3
Python Type Hints and Pydantic
Before exploring FastAPI, it is useful to explore some Python concepts that will be heavily used throughout your journey with FastAPI.
Python type hinting is a very important and relatively new feature of the language that facilitates the work of developers, bringing greater robustness and maintainability to the development workflow. Types make your code more readable and understandable, and most importantly, they promote good practices.
FastAPI is heavily based on Python type hints. So, before diving into the framework, it is useful to review the basic concepts of type hinting, what they are, how they are implemented, and what their purpose is. This foundational knowledge will help you create robust, maintainable, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access