def _typecheck(name, value, *types):
 if (not types):
  types = (unicode,)
 if (not isinstance(value, types)):
  raise TypeError('expected {} for {}, got {}'.format(' or '.join([t.__name__ for t in types]), name, repr(value)))
 return value

def _typecheck ( name , value , * types ) : if ( not types ) : types = ( unicode , ) if ( not isinstance ( value , types ) ) : raise TypeError ( 'expected {} for {}, got {}' . format ( ' or ' . join ( [ t . __name__ for t in types ] ) , name , repr ( value ) ) ) return value
check that the given c{value} is of the given c{type} .