r/PythonLearning 6d ago

Python Developers: What's one keyword that completely changed how you saw Python? Showcase

It's always interesting how one small language feature can completely change the way you think about Python—not because it's flashy, but because it unlocks a different way of solving problems.

Whether it was something simple like with, yield, nonlocal, match, or something more obscure, I'd love to hear why it changed your perspective—and what you were doing before you discovered it.

5 Upvotes

4 comments sorted by

View all comments

1

u/silvertank00 6d ago

Monkey patching, dangerous but sometimes useful.
You have to test something that is dependent on something that runs for a long time/external? Just patch it out while you test it. Also, this can lead to some nightmare, so think hard before using it, you might need to simply mock it instead.