d3py
d3py copied to clipboard
del statement fails to clean up files
(Problem exposed while dealing with pull #25)
del is not what we want to cleanup files: the reference count could be at zero even if we have stale files lying around!
One solution would be to use enter and exit and require the user to create a figure object with the with statement:
with Figure() as fig: ...do stuff with fig...
ideas?
I like using with! Shouldn't change the use case much... Let me write some wiki pages exploring the idiom...
I agree! I was going to implement it, but realized it still was quite a shift from the way things are done now. It would solve the problem quite well (intact, that's why the with
statement was made!)