does python have useless destructors?

David Turner dkturner at telkomsa.net
Mon Jun 14 11:00:07 EDT 2004


Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> wrote in message news:<pan.2004.06.14.08.53.42.980180 at knm.org.pl>...
> On Mon, 14 Jun 2004 00:00:39 -0700, David Turner wrote:
> 
> > The D programming language somehow contrives to have both garbage
> > collection and working destructors.  So why can't Python?
> 
> What happens in D when you make a pointer to a local variable,
> the variable goes out of scope, and you use the pointer?
> 
> Undefined behavior? If so, it's unacceptable for Python.

Are you suggesting that my proposed modification to the destructor
semantics will result in such misbehaviour?  If so, please tell me why
you believe that to be the case.

We're not talking about pointers here, we're talking about
reference-counted objects.

Regards
David Turner



More information about the Python-list mailing list