Why does list.index throw an exception, instead of using an arbitrary value (for example, -1
)? What\'s the idea behind this?
To me it looks cleaner to d
I agree with Devin Jeanpierre, and would add that dealing with special values may look good in small example cases but (with a few notable exceptions, e.g. NaN in FPUs and Null in SQL) it doesn't scale nearly as well. The only time it works is where: