I would appreciate advice on whether it is possible to avoid the use of a global variable used in a function by encapsulating it in a class without maaking any changes to the call interface (which I cannot change).
I have: ---------------- seen = dict() def get_it(piece): ... return seen[piece] ---------------- and I am wondering if it is possible to use a class something like ---------------- class get_it(object): seen = dict() def __call__(piece): return seen[piece] ---------------- to avoid the global variable. Brian Gladman -- https://mail.python.org/mailman/listinfo/python-list