> What about
> def f(arg):
>     if type(arg)=='list':
>         #do something

Several things:

 - list is a string in your code - which wont work:

>>> type([]) == 'list'
False

It needs to be list w/o quotes.


  - you won't get sublclasses of list:

>>> class Foo(list):
...    pass
...
>>> type(Foo()) == list
False

So better use isinstance, as I already mentioned.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to