def coerce( self, value ):
		"""Coerce the value to one of our types"""
		if self.check( value ):
			return value
		best = self.bestMatch( value )
		if best is not None:
			return best.coerce( value )
		else:
			err = None
			for typ in self:
				try:
					return typ.coerce( value )
				except (ValueError,__HOLE__), err:
					pass
			raise TypeError( """Couldn't convert %r value to any of %r (%s)"""%(
				value, tuple(self), err
			))
dataset/ETHPy150Open correl/Transmission-XBMC/resources/lib/basictypes/typeunion.py/TypeUnion.coerce