Check if something is a list

Posted by 8EM on Stack Overflow See other posts from Stack Overflow or by 8EM
Published on 2010-04-15T13:41:12Z Indexed on 2010/04/15 13:43 UTC
Read the original article Hit count: 247

Filed under:
|

What is the easiest way to check if something is a list?

A method doSomething has the parameters a and b. In the method, it will loop through the list a and do something. I'd like a way to make sure a is a list, before looping through - thus avoiding an error or the unfortunate circumstance of passing in a string then getting back each letter.

This question must have been asked before - however my googles failed me. Cheers.

© Stack Overflow or respective owner

Related posts about python

Related posts about list