slicing the end of a string in a list

John Salerno johnjsal at NOSPAMgmail.com
Mon Mar 6 17:51:54 CET 2006


Steve Holden wrote:

> It's not possible to perform an explicit close if, as in this case, you 
> don't have an explicit reference to the file object.
> 
> In CPython it's not strictly necessary to close the file, but other 
> implementations don't guarantee that a file will be closed after the 
> last reference is deleted.
> 
> So for fullest portability it's better explicitly close the file.
> 
> regards
>  Steve

Thanks!



More information about the Python-list mailing list