object.enable() anti-pattern

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu May 9 19:43:42 EDT 2013


Wayne Werner wrote:
> You don't ever want a class that has functions that need to be called in 
> a certain order to *not* crash.

That seems like an overly broad statement. What
do you think the following should do?

    f = open("myfile.dat")
    f.close()
    data = f.read()

-- 
Greg



More information about the Python-list mailing list