is parameter an iterable?

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Nov 15 17:50:02 EST 2005


lmaycotte at gmail.com wrote:
> Maybe this helps:
> 
> >>> import types
> >>> def foo(inputVal):
>       inValType = type(inputVal)
>       if inValType==types.ListType or inValType==types.TupleType:

And what of user-created types that are iterable?

What of user-created iterable types that don't inherit from any of the
built-in iterable types?

-- 
 \             "A good politician is quite as unthinkable as an honest |
  `\                                    burglar."  -- Henry L. Mencken |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list