This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients alex, amaury.forgeotdarc, benjamin.peterson, brett.cannon, brian.curtin, exarkun, giampaolo.rodola, lemburg, pitrou, r.david.murray
Date 2010-10-30.16:29:36
SpamBayes Score 2.01477e-05
Marked as misclassified No
Message-id <>
MAL wrote:
> Antoine wrote:
>> MAL wrote:
>>> I don't follow you. Where's the difference between writing:
>>> s.close()
>>> or
>>> s = None
>>> for an open socket s ?
>> The difference is when s is still referenced elsewhere.
>> Also, the intent of the former is clear while the latter is deliberately
>> obscure (while not saving any significant amount of typing).
>Sure, but that's not the point. It is not a mistake to write
>such code and neither is this obscure, otherwise we'd also
>require explicit garbage collection for other parts of Python.

Yes it is a mistake:

In an earlier message MAL wrote:
> The only difference is with Python implementations that don't
> use synchronous garbage collection, e.g. Jython, but not with
> CPython.

This by definition makes it non-equivalent and a bad *Python* idiom,
since it depends on an acknowledged CPython *implementation detail*.
As far as I know, there is no language requirement that mandates having
garbage collection at all.
Date User Action Args
2010-10-30 16:29:38r.david.murraysetrecipients: + r.david.murray, lemburg, brett.cannon, exarkun, amaury.forgeotdarc, pitrou, giampaolo.rodola, benjamin.peterson, alex, brian.curtin
2010-10-30 16:29:38r.david.murraysetmessageid: <>
2010-10-30 16:29:36r.david.murraylinkissue10093 messages
2010-10-30 16:29:36r.david.murraycreate