Answer: Storing the output of a perfect function for future use to save on overhead of running it again, b/c you know the same input will generate the same output.
Answer: It creates a temp file object that's only live during the indented scope, and is closed automatically, even if there's an exception that kicks you out of that scope.