
March 12, 2020
9:48 a.m.
It looks like actually this can be be built as a function today: def move(name): return inspect.currentframe().f_back.f_locals.pop(name) Which works as follows, but it feels awkward to pass variable names by strings (and will confuse linters): >>> for v in itertools.combinations([1, 2, 3], 1): ... print(id(move("v"))) 1718903397008 1718903397008 1718903397008 Eric