Python recently introduced the “with” keyword. It is another way of automatically cleaning up something at the end of a block. It is a way to try and get some of the destructor functionality of C++ into a garbage collected language. Garbage collection, IMHO, continues to be a mixed blessing and I think the “with” keyword is an ugly (but useful) way to deal with one of its shortcomings.
Categorised as: Programming
Comments are disabled. I got tired of spam.
Please send comments to my Facebook, or to my email address: steven at stevenrbrandt dot com.