Le Mardi 20 Juin 2006 13:28, Maric Michaud a écrit : > if not getattr(arg, '__iter__') and not getattr(arg, '__getitem__') : > raise ValueError('Function accepts only iterables') # or error handling > code
oops, hasattr of course : if not hasattr(arg, '__iter__') and not hasattr(arg, '__getitem__') : raise ValueError('Function accepts only iterables') # or error handling -- _____________ Maric Michaud _____________ Aristote - www.aristote.info 3 place des tapis 69004 Lyon Tel: +33 426 880 097 -- http://mail.python.org/mailman/listinfo/python-list