Re: python segfault

2012-03-28 Thread Kiuhnm
On 3/28/2012 8:16, Michael Poeltl wrote: yeah - of course 'while True' was the first, most obvious best way... ;-) but I was asked if there was a way without 'while True' and so I started the 'recursive function' and quick quick; RuntimeError-Exception -> not thinking much -> just adding two z

Re: python segfault

2012-03-27 Thread Michael Poeltl
hi, * Dave Angel [2012-03-28 04:38]: > On 03/27/2012 06:27 PM, Michael Poeltl wrote: > >hi, > > > >can anybody tell why this 'little stupid *thing* of code' let's > >python-3.2.2, 2.6.X or python 2.7.2 segfault? > > > >>>def get_steps2(pos=0, steps=0): > >... if steps == 0: > >... po

Re: python segfault

2012-03-27 Thread Dave Angel
On 03/27/2012 06:27 PM, Michael Poeltl wrote: hi, can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, 2.6.X or python 2.7.2 segfault? def get_steps2(pos=0, steps=0): ... if steps == 0: ... pos = random.randint(-1,1) ... if pos == 0: ... retur

Re: python segfault

2012-03-27 Thread Christian Heimes
Am 28.03.2012 00:27, schrieb Michael Poeltl: > hi, > > can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, > 2.6.X or python 2.7.2 segfault? The code segfaults because you have increased the recursion limit. The amount of recursions is limited by the stack size. A C pro

Re: python segfault

2012-03-27 Thread Chris Kaynor
On Tue, Mar 27, 2012 at 3:27 PM, Michael Poeltl wrote: > hi, > > can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, > 2.6.X or python 2.7.2 segfault? > >>> def get_steps2(pos=0, steps=0): > ...     if steps == 0: > ...         pos = random.randint(-1,1) > ...     if pos