469,929 Members | 1,831 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

useless destructors

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
Jul 18 '05 #1
9 1527
On Tue, 22 Jun 2004 02:36:24 -0700, David Turner wrote:
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


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
\__/ qr****@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/

Jul 18 '05 #2
In article <pa****************************@knm.org.pl>,
Marcin 'Qrczak' Kowalczyk <qr****@knm.org.pl> wrote:
On Tue, 22 Jun 2004 02:36:24 -0700, David Turner wrote:
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


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.


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.
Jul 18 '05 #3
Marcin 'Qrczak' Kowalczyk <qr****@knm.org.pl> wrote in message news:<pa****************************@knm.org.pl>.. .
On Tue, 22 Jun 2004 02:36:24 -0700, David Turner wrote:
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


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.


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
Jul 18 '05 #4
In article <e2**************************@posting.google.com >,
David Turner <dk******@telkomsa.net> wrote:

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


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 (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"Typing is cheap. Thinking is expensive." --Roy Smith, c.l.py
Jul 18 '05 #5
On Saturday 03 July 2004 02:20 pm, Aahz wrote:
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.


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, tr**@gci.net
--
The riddles of God are more satisfying than the solutions of man. - G. K.
Chesterton
Jul 18 '05 #6
Aahz <aa**@pythoncraft.com> wrote:
David Turner <dk******@telkomsa.net> wrote:
http://dkturner.blogspot.com/2004/06...and-using.html


Finally had a chance to try this, and you're using a webserver that
barfs with Lynx.


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)
Jul 18 '05 #7
In article <2k************@uni-berlin.de>,
Oliver Fromme <ol**@haluter.fromme.com> wrote:

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.


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

"Typing is cheap. Thinking is expensive." --Roy Smith, c.l.py
Jul 18 '05 #8
Aahz <aa**@pythoncraft.com> wrote:
Oliver Fromme <ol**@haluter.fromme.com> wrote:
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.


They work better as browsers, technically, but their keyboard operations
are much poorer.


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)
Jul 18 '05 #9
aa**@pythoncraft.com (Aahz) writes:
In article <2k************@uni-berlin.de>,
Oliver Fromme <ol**@haluter.fromme.com> wrote:

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.


They work better as browsers, technically, but their keyboard operations
are much poorer.


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
Jul 18 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rajesh Garg | last post: by
3 posts views Thread by Nuno Barros | last post: by
8 posts views Thread by johny smith | last post: by
26 posts views Thread by Michi Henning | last post: by
8 posts views Thread by Edward Diener | last post: by
3 posts views Thread by alex.gman | last post: by
6 posts views Thread by mlw | last post: by
6 posts views Thread by Jeff Newman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.