| View previous topic :: View next topic |
| Author |
Message |
trefeda
Joined: 21 Jun 2006 Posts: 6
|
| What's Python's maximum recursion depth? |
| |
|
|
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Depends on the platform. |
| |
|
|
trefeda
Joined: 21 Jun 2006 Posts: 6
|
| Windows and Linux? |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| trefeda, the default is easily gotten with sys.getrecursionlimit(). howmuch beyond that you can go depends on many factors. And if you set the stacklimit manually, it depends on both the C stack limit and the size of the frames you create. |
| |
|
|
trefeda
Joined: 21 Jun 2006 Posts: 6
|
| Wow, the default's only 1000. I didn't realize it was that low. |
| |
|
|
martinar_kauaro
Joined: 18 Jun 2006 Posts: 4
|
| trefeda, are you doing something that's running into the limit? |
| |
|
|
trefeda
Joined: 21 Jun 2006 Posts: 6
|
| Why does Python have a fixed stack size? Why not make it arbitrarily resizable? |
| |
|
|
rczywkkki
Joined: 14 May 2006 Posts: 1
|
| trefeda: the stack size isn't Python's limitation, but the platform's. |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| trefeda, unfortunately, there isn't a usable way to detect you're nearing the end of the platform stack size (except, apparently, on Windows). |
| |
|
|
trefeda
Joined: 21 Jun 2006 Posts: 6
|
| martinar_kauaro, Not yet. I'm just considering how I might implement a tree search algorithm. |
| |
|
|
| Page 1 of 2 |
Goto page 1, 2 Next |
|