Re:Strict Python function parameters
by wheelerof4te on Sunday January 23, 2022 @01:48PM
(#30049046)
Pythonic way to solve this problem would be to make Bar() a component of another class.
Functions are not a good tool for storing stateful objects in Python. That's why classes exist.
It’s boilerplate that distracts from the purpose of the function, this getting in the way of readability.
It’s also just more code prone to a programmer screwing up from time to time, despite how simple it is.