3 ms·
> That's the only way of creating function with state without introducing closure or making an object with __call__ What about this? def foo(): if not
by leohutson 13y ago
> That's the only way of creating function with state without introducing closure or making an object with __call__
What about this?
def foo():
if not hasattr(foo, 'static_list'):
foo.static_list = []
At least it's a bit easier to see that something funky is going on.