Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90870

Re: Why does the first loop go wrong with Python3

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.pionier.net.pl!feed.xsnews.nl!border03.ams.xsnews.nl!feeder03.ams.xsnews.nl!abp001.ams.xsnews.nl!frontend-F10-16.ams.news.kpn.nl
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.python
Subject Re: Why does the first loop go wrong with Python3
Organization Decebal Computing
References <878uckvjoy.fsf@Equus.decebal.nl> <mailman.133.1432041396.17265.python-list@python.org> <874mn8vd8n.fsf@Equus.decebal.nl> <mailman.142.1432050607.17265.python-list@python.org>
X-Face "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR<J%a^F2lh4[N~Yz4 nSp#c+aQo1b5=?HcNEkQ7QzF<])O3X4MDL/AYjys&*mt>,v+Pti8=Vi/Z"g^?b"E
X-Homepage http://www.decebal.nl/
Date Tue, 19 May 2015 18:39:38 +0200
Message-ID <87wq04ttbp.fsf@Equus.decebal.nl> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:89ofGBoFgUuWj6kChYBQ40ZU6IM=
MIME-Version 1.0
Content-Type text/plain
Lines 30
NNTP-Posting-Host 81.207.62.244
X-Trace 1432053927 news.kpn.nl 21130 81.207.62.244@kpn/81.207.62.244:48831
Xref csiph.com comp.lang.python:90870

Show key headers only | View raw


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

> On Tue, May 19, 2015 at 8:44 AM, Cecil Westerhof <Cecil@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why does the first loop go wrong with Python3 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-19 14:24 +0200
  Re: Why does the first loop go wrong with Python3 Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-05-19 14:16 +0100
    Re: Why does the first loop go wrong with Python3 Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2015-05-19 16:38 +0200
    Re: Why does the first loop go wrong with Python3 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-19 16:44 +0200
      Re: Why does the first loop go wrong with Python3 Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-19 09:49 -0600
        Re: Why does the first loop go wrong with Python3 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-19 18:39 +0200
          Re: Why does the first loop go wrong with Python3 Chris Angelico <rosuav@gmail.com> - 2015-05-20 03:11 +1000

csiph-web