Q:

Arcpy Map Algebra: Maximum Number of Nestings

When using Map Algebra you can nest multiple expressions as can be seen in the Esri example below.  Is there a limit on how many long of a statement you can have OR a limit on how many Con statements you can nest?  If there is no limit, is there a best practice?
OutRas = Con(InRas1 > 23, 5, Con(InRas1 > 20, 12, Con((InRas1 > 2) & (InRas1 < 17), Sin(InRas1), 100)))

A:

I haven't found a limit in the number of nestings in a Map Algebra expression, however there is a limit to the length of the expression itself:

The maximum length of the logical expression is 4,096 characters

See Con - ArcGIS Desktop Help.
My guess is that if you hit a limit to the number of nestings in an expression, it will be based on your system resources and not on any hard limit in the Map Algebra tools.  I don't have any evidence to back this theory however.

