O'Reilly logo
  • Ioannis Refanidis thinks this is interesting:

>>> del a >>> a.close()

From

Cover of Beginning Python®: Using Python 2.6 and Python 3.1

Note

I suppose that the correct order is first to close the file and then delete the file object