Message120000
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:38 | r.david.murray | set | recipients:
+ r.david.murray, lemburg, brett.cannon, exarkun, amaury.forgeotdarc, pitrou, giampaolo.rodola, benjamin.peterson, alex, brian.curtin |
2010-10-30 16:29:38 | r.david.murray | set | messageid: <1288456178.46.0.450370924378.issue10093@psf.upfronthosting.co.za> |
2010-10-30 16:29:36 | r.david.murray | link | issue10093 messages |
2010-10-30 16:29:36 | r.david.murray | create | |
|