Connecting Tech Pros Worldwide Help | Site Map

useless destructors

David Turner
Guest
 
Posts: n/a
#1: Jul 18 '05
Further to the discussion from earlier titled "does python have
useless destructors?", I've posted a brief summary of garbage
collection, RAII, and the "using" clause (which is what PEP310's
"with" clause amounts to). The post is here:

http://dkturner.blogspot.com/2004/06...and-using.html

Regards
David Turner
Marcin 'Qrczak' Kowalczyk
Guest
 
Posts: n/a
#2: Jul 18 '05

re: useless destructors


On Tue, 22 Jun 2004 02:36:24 -0700, David Turner wrote:
[color=blue]
> Further to the discussion from earlier titled "does python have
> useless destructors?", I've posted a brief summary of garbage
> collection, RAII, and the "using" clause (which is what PEP310's
> "with" clause amounts to). The post is here:
>
> http://dkturner.blogspot.com/2004/06...and-using.html[/color]

You left "for later" a point which makes the last proposition unworkable:
how to implement selective refcounting in a dynamically typed language?
Will it still work if the refcounted object is referred to from a plain
object? The only way I can imagine is to manage refcounts on each object
passing, returning and rebinding.

--
__("< Marcin Kowalczyk
\__/ qrczak@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/

Roy Smith
Guest
 
Posts: n/a
#3: Jul 18 '05

re: useless destructors


In article <pan.2004.06.22.09.56.49.888803@knm.org.pl>,
Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl> wrote:
[color=blue]
> On Tue, 22 Jun 2004 02:36:24 -0700, David Turner wrote:
>[color=green]
> > Further to the discussion from earlier titled "does python have
> > useless destructors?", I've posted a brief summary of garbage
> > collection, RAII, and the "using" clause (which is what PEP310's
> > "with" clause amounts to). The post is here:
> >
> > http://dkturner.blogspot.com/2004/06...and-using.html[/color]
>
> You left "for later" a point which makes the last proposition unworkable:
> how to implement selective refcounting in a dynamically typed language?
> Will it still work if the refcounted object is referred to from a plain
> object? The only way I can imagine is to manage refcounts on each object
> passing, returning and rebinding.[/color]

Well, you could take a page from perl, and "taint" refcounted objects.
Any time you make a reference to an object, if the referenced object is
refcounted, the referrer becomes refcounted too.

The next question is, would this in practice end up refcounting most
objects? If so, that would sort of defeat the purpose.
David Turner
Guest
 
Posts: n/a
#4: Jul 18 '05

re: useless destructors


Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl> wrote in message news:<pan.2004.06.22.09.56.49.888803@knm.org.pl>.. .[color=blue]
> On Tue, 22 Jun 2004 02:36:24 -0700, David Turner wrote:
>[color=green]
> > Further to the discussion from earlier titled "does python have
> > useless destructors?", I've posted a brief summary of garbage
> > collection, RAII, and the "using" clause (which is what PEP310's
> > "with" clause amounts to). The post is here:
> >
> > http://dkturner.blogspot.com/2004/06...and-using.html[/color]
>
> You left "for later" a point which makes the last proposition unworkable:
> how to implement selective refcounting in a dynamically typed language?
> Will it still work if the refcounted object is referred to from a plain
> object? The only way I can imagine is to manage refcounts on each object
> passing, returning and rebinding.[/color]

To answer your second question first: no, of course it won't -- the
contained object will be destroyed only when the container is garbage
collected. But of course, that's the behaviour you'd expect. I don't
see it as a serious concern.

Your first point is well made. I agree that it would be extremely
difficult to implement deterministic destruction in Python. As you've
pointed out before, the overhead is considerable on some significant
platforms, and worst of all, it's not limited to cases where
deterministic destruction is used (although I still believe that the
additional overhead for other objects should be pretty minor).

Regards
David Turner
Aahz
Guest
 
Posts: n/a
#5: Jul 18 '05

re: useless destructors


In article <e251b7ba.0406220136.6110088f@posting.google.com >,
David Turner <dkturner@telkomsa.net> wrote:[color=blue]
>
>Further to the discussion from earlier titled "does python have
>useless destructors?", I've posted a brief summary of garbage
>collection, RAII, and the "using" clause (which is what PEP310's
>"with" clause amounts to). The post is here:
>
>http://dkturner.blogspot.com/2004/06...and-using.html[/color]

Finally had a chance to try this, and you're using a webserver that
barfs with Lynx. That makes me completely uninterested in anything
you've got to say.
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/

"Typing is cheap. Thinking is expensive." --Roy Smith, c.l.py
Troy Melhase
Guest
 
Posts: n/a
#6: Jul 18 '05

re: useless destructors


On Saturday 03 July 2004 02:20 pm, Aahz wrote:[color=blue]
> Finally had a chance to try this, and you're using a webserver that
> barfs with Lynx. That makes me completely uninterested in anything
> you've got to say.[/color]

Why do you even bother to defend your browsing preferences like this? You're
in the hopeless minority, and you do neither David nor yourself any good by
being rude. I don't care about your browser preference, or why you choose
not to visit some sites -- just as I don't care for your attitude towards
others.

Put another way: Would it be so hard to simply ask for the site in reasonable
HTML? Or to simply ignore it?

Put a third way: This list is for the discussion on the use of the python
language. The group you want is alt.opensource.community.badexample.


--
Troy Melhase, troy@gci.net
--
The riddles of God are more satisfying than the solutions of man. - G. K.
Chesterton


Oliver Fromme
Guest
 
Posts: n/a
#7: Jul 18 '05

re: useless destructors


Aahz <aahz@pythoncraft.com> wrote:[color=blue]
> David Turner <dkturner@telkomsa.net> wrote:[color=green]
> > http://dkturner.blogspot.com/2004/06...and-using.html[/color]
>
> Finally had a chance to try this, and you're using a webserver that
> barfs with Lynx.[/color]

FWIW, it doesn't work with _any_ browser that I've tried
(links, elinks, w3m, dillo, opera, and a self-written one).
HEAD requests do work (and indicate it's an Apache server,
unless the server signature is faked), but GET requests do
not. There's probably something seriously broken with that
web server.

Best regards
Oliver

PS: I didn't bother to try lynx, because it is the least
useful browser anyway. :-) Actually I'm surprised that
there are still people who insist on using it, since there
are better alternatives such as links or w3m.

--
Oliver Fromme, Konrad-Celtis-Str. 72, 81369 Munich, Germany

``All that we see or seem is just a dream within a dream.''
(E. A. Poe)
Aahz
Guest
 
Posts: n/a
#8: Jul 18 '05

re: useless destructors


In article <2ktlakF6atfrU2@uni-berlin.de>,
Oliver Fromme <olli@haluter.fromme.com> wrote:[color=blue]
>
>PS: I didn't bother to try lynx, because it is the least useful
>browser anyway. :-) Actually I'm surprised that there are still people
>who insist on using it, since there are better alternatives such as
>links or w3m.[/color]

They work better as browsers, technically, but their keyboard operations
are much poorer.
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/

"Typing is cheap. Thinking is expensive." --Roy Smith, c.l.py
Oliver Fromme
Guest
 
Posts: n/a
#9: Jul 18 '05

re: useless destructors


Aahz <aahz@pythoncraft.com> wrote:[color=blue]
> Oliver Fromme <olli@haluter.fromme.com> wrote:[color=green]
> > PS: I didn't bother to try lynx, because it is the least useful
> > browser anyway. :-) Actually I'm surprised that there are still people
> > who insist on using it, since there are better alternatives such as
> > links or w3m.[/color]
>
> They work better as browsers, technically, but their keyboard operations
> are much poorer.[/color]

Can you be a little more specific, please?

The keyboard navigation of links particularly mimics that
of lynx pretty closely, as far as I can tell. However, I
agree that the navigation in w3m is somewhat different
(but it has its advantages, too, once you get used to it).

Well, it's all a matter of taste, I guess.

Best regards
Oliver

--
Oliver Fromme, Konrad-Celtis-Str. 72, 81369 Munich, Germany

``All that we see or seem is just a dream within a dream.''
(E. A. Poe)
Michael Hudson
Guest
 
Posts: n/a
#10: Jul 18 '05

re: useless destructors


aahz@pythoncraft.com (Aahz) writes:
[color=blue]
> In article <2ktlakF6atfrU2@uni-berlin.de>,
> Oliver Fromme <olli@haluter.fromme.com> wrote:[color=green]
> >
> >PS: I didn't bother to try lynx, because it is the least useful
> >browser anyway. :-) Actually I'm surprised that there are still people
> >who insist on using it, since there are better alternatives such as
> >links or w3m.[/color]
>
> They work better as browsers, technically, but their keyboard operations
> are much poorer.[/color]

Well, different. I can't stand lynx.

Cheers,
mwh

--
If you don't use emacs, you're a pathetic, mewling, masochistic
weakling and I can't be bothered to convert you. -- Ron Echeverri
Closed Thread


Similar Python bytes