def _get_unpassable_types(arg):
 if isinstance(arg, (basestring, int, long)):
  return set()
 elif isinstance(arg, (list, tuple, set, frozenset, dict)):
  if isinstance(arg, dict):
   parts = itertools.chain(arg.iterkeys(), arg.itervalues())
  else:
   parts = iter(arg)
  types = set()
  for part in parts:
   types |= _get_unpassable_types(part)
  return types
 else:
  return set([type(arg)])

def _get_unpassable_types ( arg ) : if isinstance ( arg , ( basestring , int , long ) ) : return set ( ) elif isinstance ( arg , ( list , tuple , set , frozenset , dict ) ) : if isinstance ( arg , dict ) : parts = itertools . chain ( arg . iterkeys ( ) , arg . itervalues ( ) ) else : parts = iter ( arg ) types = set ( ) for part in parts : types |= _get_unpassable_types ( part ) return types else : return set ( [ type ( arg ) ] )
given an argument .