We generalize McDiarmid's inequality for functions with bounded differences on a high probability set, using an extension argument. Those functions concentrate around their conditional expectations. We illustrate the usefulness of this generalized inequality on a few examples. We further extend the results to concentration in general metric spaces.