Can I check if something is a list? [SOLVED]

I’m making an expandable menu class than I plan on sharing with the community. The basic idea of the class is to take a list of lists as an argument, and from that list of lists construct everything the menu needs to be able to do. This is an outline of what I’m thinking of for the argument list that the menu would build off of.

Argument List:
   0: Type of menu
   1: Menu Item Strings (the thing displayed)
   2: List of functions for each item to execute if selected.
      0: List of functions for item 0
      1: List of functions for item 1
      N: List of functions for item N
   3: List of arguments for functions
      0: List of Argument Lists for item 0
         0: List of Arguments for function 0 of item 0
         1: List of Arguments for function 1 of item 0
         N: List of Arguments for function N of item 0
      1: List of Argument Lists for item 1
         0: List of Arguments for function 0 of item 1
         1: List of Arguments for function 1 of item 1
         N: List of Arguments for function N of item 1
      N: List of Argument Lists for item N
         0: List of Arguments for function 0 of item N
         1: List of Arguments for function 1 of item N
         N: List of Arguments for function N of item N

The obvious thing to do is, even if the menu only needs to execute one function, put that function in a list anyway. However, I’d rather be able to provide the option of not putting single functions in a list. That would mean the menu needs to be able to ascertain if a particular menu item has a single function or a list of functions associated with it. Is there a way to make that check?

The functions that are called by the menu would need to take a single list argument and break that apart into whatever they need, but that shouldn’t be a big deal, I don’t think.

If I am understanding your post correctly (alot to take in logically) then:

if type(isThisAList) == list:
    print 'isThisAList is actually a list!'
else:
    print 'It's something different'

Wow, it’s really that easy, huh? Let me try that out…

Yup, that works. Thanks a bunch.

your welcome :smiley: