We show a natural graph-theoretic generalization of the Sauer–Shelah lemma. This result is applied to bound the ‘∞ and L1 packing numbers of classes of functions whose range is an arbitrary, totally bounded metric space. ? 1998 Elsevier Science B.V. All rights reserved.