"finally" for unit test
bbxx789_05ss at yahoo.com
Fri Mar 23 18:55:03 CET 2007
On Mar 23, 5:18 am, "killkolor" <gabriel.h... at gmail.com> wrote:
> I have .. a single function that ..
> works with files (takes input and outputs in the same file, no return
That function could cause problems. If your function reads in the
whole file, modifies the data, and then overwrites the file, what
would happen if something unforeseen happened and your program crashed
after writing one line to the file? All the data in memory would go
poof! and your file would contain 1 line it--effectively erasing the
entire contents of the file.
More information about the Python-list