After writing class-based and function-based context managers, this lesson compares both of them and names certain trade-offs that might occur.
For more information on context managers, check out Context Managers and Python’s with Statement as either a written tutorial or a video course.
Congratulations, you made it to the end of the course! Make it stick: Mentor AI will check what you’ve got down, help you build something with it, and find your #1 takeaway to share in the discussion.
Or go straight to the discussion section and share your #1 takeaway and how you’ll put your new skills to use.
mikesult on March 3, 2020
Nice to get an understanding of the context manager protocol and how some of the dunder methods work. Thank you for another great tutorial.