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/111238.html below:

[Python-Dev] Linus on garbage collection

[Python-Dev] Linus on garbage collection [Python-Dev] Linus on garbage collectionGregory P. Smith greg at krypto.org
Fri May 6 18:32:51 CEST 2011
On Fri, May 6, 2011 at 9:18 AM,  <skip at pobox.com> wrote:
>
>    Antoine> Since we're sharing links, here's Matt Mackall's take:
>    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.

Python being "broken" in this regard is pretty much exactly why
__enter__, __exit__ and with as context managers were added to the
language.

That gives the ability to have the equivalent of well defined nested
scopes that destroy something (exit) deterministically much as it is
easy to do in C++ with some {}s and a ~destructor().

It is not broken, just different.

-gps
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