same way, recursively: check 1st element if mylist and isinstance( mylist[0], yourlisttype): ... or check all elements, or...
On Thursday 12 April 2007 17:52:28 Disrupt07 wrote: > Thanks. 'if isinstance(your_object, > sqlalchemy.orm.attributes.InstrumentedList):' was helpful to me. > > Now I want to check if the given list is either a list of elements > or a list of lists. > Example: > list1 = ['a', 'b', 'c'] > list2 = [['a', 'b'], ['c', 'd'], ['e']] > > How can I check for lists within a list so that I would know what > type of list I am processing? > > Thanks > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---