How can I verify that a passed argument is an interible collection?

Roy Smith roy at panix.com
Thu Apr 21 11:01:23 EDT 2005


Charles Krug  <cdkrug at worldnet.att.net> wrote:
> Do I *coughs* simply *coughs* trap the exception created by:
>
>    for v in x:
>
>when v is a scaler quantity?

Sure.  Why not?  If you're coming from a type-bondage language like
C++ or Java, it probabliy feels strange, but it's the Python way.  It
looks like what you want to catch is TypeError.



More information about the Python-list mailing list