how many nested for can we utilize?

Lie Lie.1296 at gmail.com
Mon Aug 18 11:04:18 EDT 2008


On Aug 17, 4:23 pm, Fredrik Lundh <fred... at pythonware.com> wrote:
> Patrol Sun wrote:
> > when I use 20 for ,"SystemError: too many statically nested blocks"
> > When I use 100 for ,"IndentationError: too many levels of indentation"
> > How to handle these errors?
>
> so why exactly are you trying to nest 20 or 100 for-in loops?
>
> </F>

I think most (all?) algorithm that might use 20+ levels of for-in
loops could almost always be replaced with a recursive function. Or at
least they could be broken into smaller functions.



More information about the Python-list mailing list