In an interactive Python session, I sometimes do dumb things like
plot.ylimits = (0,100)
where plot is an instance of some class Plot, and ylimits is the method for it. I should have used this:
plot.ylimits(0,100)
How Python works, the plot object now has a new member named ylimits, which has a tuple as its value, and the method is an executable routine, originally provided by the Plot class, which was used to call with ylimits (...) left. Maybe, somewhere in my mind, I think that ylimits is a property, and assigning it calls some kind of hidden setter method, as is done in some other languages.
How do I return this method? How can I restore the object of my plot while remaining in an interactive session, where I use many other variables, functions, etc.?
I find that rebooting (theplotmodule) does not do this work. I destroyed a specific instance of Plot; updating the definition of the Plot class and other things does not help.
I am using Python 2.7
source share