please help shrink this each_with_index() implementation

Antoine Pitrou solipsis at
Wed Jan 6 03:28:08 CET 2010

> The point: int('') or int('something') both throw an error. In general,
> this is hand-holding, but in specific I don't think the "rich and
> structured" documentation will cover how to beat a 0 out of it in less
> than 3 lines.

Because it's a bad idea to do so and Python doesn't encourage such sloppy 
behaviour. If you like it, though, you might prefer PHP.

By the way: error reporting is definitely *not* hand-holding. It is 
simply not good to let errors pass silently by default. Again, if you 
think the contrary, PHP is your friend ;-)

More information about the Python-list mailing list