Python 2.0

Hisao Suzuki suzuki611 at
Thu Jun 3 03:08:42 CEST 1999

In article <7j45iv$908$4 at>,
graham at (Graham Matthews) wrote:
> You also seem to believe that with GC finalisation will disappear. Why
> do you believe that (a lot of GC schemes have finalisation). 

You might misunderstand Donn's saying.  As far as I understand,
he says that explicit finalization (or close call, in your
wording) disappears if reference counting is used; finalization
will be done implicitly with destructor such as __del__(self)
all at the expected time then.

> Finally I
> believe you are mis-using finalisation if you use it to close up files,
> sockets, etc. That's what close calls are for.

You are all right in some other languages.  However, if we adopt
such a manner as Pythonic style, we would have to write the code
like this:

	a = SomeClass(....)
	try: something with a...

instead of providing the __del__ method for SomeClass once and
for all.

--===-----========------------- Sana esprimo naskas sanan ideon.
SUZUKI Hisao            suzuki611 at, suzuki at

More information about the Python-list mailing list