Best practice: close file object in example