Why does the first loop go wrong with Python3

Cecil Westerhof Cecil at decebal.nl
Tue May 19 12:39:38 EDT 2015


Op Tuesday 19 May 2015 17:49 CEST schreef Ian Kelly:

> On Tue, May 19, 2015 at 8:44 AM, Cecil Westerhof <Cecil at decebal.nl> wrote:
>> I looked at the documentation. Is it necessary to do a:
>> p.wait()
>> afterwards?
>
> It's good practice to clean up zombie processes by waiting on them,
> but they will also get cleaned up when your script exits.

You are right. I played a little with ipython3, which made finding
things out a lot easier. ;-)

In my case it is a script, that terminates very soon after being
finished with p, but it is certainly good practise to do it myself.

I always did a free in my C programming days. I was always told it was
not necessary, but I found it better to do it anyway.


By the way, what also works is:
    p = None

But it was just a try in ipython3. I would never do this in real code.
I was just curious if this would be handled correctly and it is. :-)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list