is parameter an iterable?

Steven D'Aprano steve at
Thu Nov 17 09:02:16 CET 2005

Roy Smith wrote:

> Now you're assuming that the message is a constant for all TypeErrors
> caused by attempting to iterate over a non-iterable object.

Yes I am, and of course you are correct that that could 
change and so shouldn't be relied on.

Seems that my crappy solution is not quite as 
future-proof as I thought it was. Since a better 
solution does exist, I agree it should be used in 
preference to my crappy one, assuming you are running a 
recent enough version of Python.


More information about the Python-list mailing list