Shouldn't this be _tn instead of tn? Also, may be instead of using del, just set it to None, in terms of memory usage it should be equivalent, and we don't have to use strings like this.