A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-May/111259.html below:

[Python-Dev] Linus on garbage collection

[Python-Dev] Linus on garbage collection [Python-Dev] Linus on garbage collectionGreg Ewing greg.ewing at canterbury.ac.nz
Sat May 7 01:43:16 CEST 2011
Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html
> 
>>From that note:
> 
>     1: You can't have meaningful destructors, because when destruction
>     happens is undefined. And going-out-of-scope destructors are extremely
>     useful. Python is already a rather broken in this regard, so feel free
>     to ignore this point.

It's only broken if you regard RAII as the One True Way to
implement scoped resource management. Python has other approaches
to that, such as the with-statement.

Also, you *can* have destructors that work for objects in cycles,
as long as you don't insist on the destructor having access to
the object that's being destroyed. Weakref callbacks provide a
way of implementing this in CPython.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4