Finalize Method In Python Example Code