Courses
Python Advanced: Code That Scales Past Your Own Laptop
Check Yourself: Catch Bugs Before You Run the Code
Five scenario questions on type hints and mypy. If you miss more than one, reread the two lessons before moving on.
Course content
Join this Course
Sign in to save your progress.
-
Functions That Wrap Functions
-
Python Closures: Functions That Remember
-
Python Decorators in Real Code: Timing, Retry and Logging
-
-
-
Data That Doesn't Fit in Memory
-
Python Iterators: What a for Loop Actually Does
-
Python Generators and yield: One Piece at a Time
-
Python Context Managers: Clean Up Even When Things Fail
-
-
-
Catch Bugs Before You Run the Code
-
Python Type Hints Beyond the Basics: Optional, Union, Generics
-
Checking Types With mypy in a Real Project
-
-
-
Doing More Than One Thing at a Time
-
Python Concurrency Basics: Threads, Processes or asyncio?
-
Python asyncio: Wait for Many Things Without Waiting Longer
-
-
-
Ship It, Then Make It Fast
-
Packaging a Python Project With pyproject.toml
-
Profiling Python Code: Measure Before You Optimize
-
-
- Final Check: Python Advanced
1.
A function is hinted -> str but returns None when no customer is found. What is wrong with that?
2.
Your function only loops over its argument once. Which hint accepts a list, a tuple and a generator?
3.
mypy reports nothing for an old function without any hints, even though it clearly has a bug. Why?
4.
mypy says Item "None" of "str | None" has no attribute "lower". What is the right fix?
5.
mypy says a third-party library is missing stubs. What should you try first?
About
Five scenario questions on type hints and mypy. If you miss more than one, reread the two lessons before moving on.
- Duration
- 5 min
- Last update
- 09/03/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.