Someone wanted to learn this too, so Grasp built them a personal learning path.
Create your ownPython Context Managers and ContextVars
Module 2
Understanding What a `with` Statement Calls
Module 3
Connecting One `yield` to One `with` Block
Module 4
Seeing Why Mutation Is Shared but Rebinding Is Not
Module 5