What would be the corresponding context manager for the summing example, where you use the square function and the inverse (the square root) ?
Context managers works well for files (or general relations on objects really) but less for more abstract operations, I've found.