Strange thing: file.close did not show error but work wrong

Kragen Sitaker kragen at canonical.org
Fri Nov 23 22:53:11 EST 2001


"Emile van Sebille" <emile at fenx.com> writes:

> "wqhdebian" <wqhdebian at 263.net> wrote in message
> news:db288b61.0111211822.2e903177 at posting.google.com...
> > fdw.close#########################  When I use like this ,there is no
> > warning and
> > ##############any error message,but the file do not have been
> > writen.After I change back to fdw.close(),Then it work well.
> 
> Yes, this is all as it should be.

It's semantically consistent with the rest of Python, but it's
suboptimal from a human-factors perspective, IMHO; people who are used
to Perl or Delphi or Pascal will expect it to call fdw.close.  It
would be nice if the interpreter were smart enough to issue a warning
in this case: a method is gotten and then immediately discarded.





More information about the Python-list mailing list