On Sep 20, 6:35 pm, Aidan <[EMAIL PROTECTED]> wrote:
> satoru wrote:
> > hi, all
> > i want to check if a variable is iterable like a list, how can i
> > implement this?
>
> this would be one way, though I'm sure others exist:
>
> if hasattr(yourVar, '__iter__'):
>         # do stuff

thank you,but this will miss out sequences like string just because it
doesn't have an attribute named '__iter__'
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to