Posts by Diego Carvalho • 1 point
1 post
-
0
votes2
answers40971
viewsA: Problem using Switch Case in Python 3
I prefer to use context managers... Follow a suggestion from Ian Bell. class Switch: def __init__(self, value): self._val = value def __enter__(self): return self def __exit__(self, type, value,…