473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1627
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rajesh Garg | last post by:
Can we have private constructors and destructors? IF yes what is the use of such constructors or destructors.....in the sense where can these be implemented in a system................. I have...
3
by: Nuno Barros | last post by:
Cn someone tell me if when i call the destructor of a derivated class, the destructor of the base class is called implicitly? Or shall i call the destructor by myself? Thanks in advance ...
12
by: Ross Boylan | last post by:
I am trying to understand under what circumstances destructors get called with std::vector. I have an application in which I will put real objects, not just pointers, in the vector. 1. The...
8
by: johny smith | last post by:
If I have a simple class with say a couple of integers only is there any need for me to provide a destructor? thanks!
26
by: Michi Henning | last post by:
I've been having problem with destructors in the context of having ported C# code developed under .NET to Mono. What happens is that, on a dual-CPU machine, various parts of the code crash randomly...
8
by: Edward Diener | last post by:
I have a __value class which uses some legacy C++ code. So I wrapped the legacy C++ code in another __nogc class and have a pointer to that class as a member of my __value class. When the __value...
3
by: alex.gman | last post by:
If I have code like this int f() { // ... stuff ... g(); if(x > 0) return (x+4); // ... more stuff ... always_call(z); return y; }
6
by: mlw | last post by:
Could someone explain why there is no destructor in Java classes? There are many times you need to be called WHEN an object goes out of scope and not when it will eventally be freed.
6
by: Jeff Newman | last post by:
Hello, Could anyone explain to me why the following class's destructor shows up as having multiple branches? (At least as judged by gcov 4.1.2 when compiled with gcc 4.1.2 ): struct blah {...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.