__del__()

22 views
Skip to first unread message

Nicolas Pinault

unread,
May 29, 2016, 4:24:40 AM5/29/16
to bry...@googlegroups.com
Hi,

When a class is automatically destroyed, the __del__() function is not
called.
I'm working on an application where this is very annoying.
Is it a definitive behaviour ?

Nicolas

Kiko

unread,
May 29, 2016, 4:34:37 PM5/29/16
to bry...@googlegroups.com
Nicolas

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/a9df7710-7416-bea5-5fed-e3d14f6c18f9%40famillepinault.fr.
For more options, visit https://groups.google.com/d/optout.

Nicolas Pinault

unread,
May 30, 2016, 12:29:12 PM5/30/16
to bry...@googlegroups.com
Le 29/05/2016 à 22:34, Kiko a écrit :


2016-05-29 10:24 GMT+02:00 Nicolas Pinault <d...@famillepinault.fr>:
Hi,

When a class is automatically destroyed, the __del__() function is  not called.
I'm working on an application where this is very annoying.
Is it a definitive behaviour ?

Yes, I know. But are there any plans to change this ?

Nicolas

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/a9df7710-7416-bea5-5fed-e3d14f6c18f9%40famillepinault.fr.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.

André

unread,
May 30, 2016, 4:19:42 PM5/30/16
to brython


On Monday, 30 May 2016 13:29:12 UTC-3, nico38 wrote:
Le 29/05/2016 à 22:34, Kiko a écrit :


2016-05-29 10:24 GMT+02:00 Nicolas Pinault <d...@famillepinault.fr>:
Hi,

When a class is automatically destroyed, the __del__() function is  not called.
I'm working on an application where this is very annoying.
Is it a definitive behaviour ?

Yes, I know. But are there any plans to change this ?


Nicolas Pinault

unread,
May 31, 2016, 2:23:47 PM5/31/16
to bry...@googlegroups.com
Thanks for the link. I missed it when searching for this topic.


--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.

Kiko

unread,
Jun 3, 2016, 4:16:21 AM6/3/16
to bry...@googlegroups.com
2016-05-31 20:23 GMT+02:00 Nicolas Pinault <d...@famillepinault.fr>:
Le 30/05/2016 à 22:19, André a écrit :


On Monday, 30 May 2016 13:29:12 UTC-3, nico38 wrote:
Le 29/05/2016 à 22:34, Kiko a écrit :


2016-05-29 10:24 GMT+02:00 Nicolas Pinault <d...@famillepinault.fr>:
Hi,

When a class is automatically destroyed, the __del__() function is  not called.
I'm working on an application where this is very annoying.
Is it a definitive behaviour ?

Yes, I know. But are there any plans to change this ?


No.

Thanks for the link. I missed it when searching for this topic.

I was rethinking about this. Some thoughts:
-CPython uses reference counting and a GC.
-Javascript uses reference counting and a GC.
-In CPython there are some utilities to know about and interface with the GC, the references,...
-In Javascript you don't have this...

So:
-As Pierre stated, maybe it is better like this as implement this would be difficult and, maybe, unmanageable.

Ideas:
I think the easiest way to deal with this would be to let the developer be responsible of this so the developer can try to force the variables to be equal to None once they are used (but, if there are references to the same value you will not free memory as the JS GC would be in charge of this).

Best.

 

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/b68245f5-045d-47f6-b2cc-8692a03d25f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages