|
|
|
|
|
by Chris2048
3548 days ago
|
|
I believe all functions are object in python, so you can add attributes to them, but you'd be better of creating a class with a __call__ method. Relevant scope can be captured in the class __init__. Classes themselves can hold multiple functions/methods, and if you want a function that carries state, maybe a generator would be useful? |
|