def LookupChain(lookup_func_list):
  """Returns a *function* suitable for passing as the more_formatters argument
  to Template.

  NOTE: In Java, this would be implemented using the 'Composite' pattern.  A
  *list* of formatter lookup function behaves the same as a *single* formatter
  lookup funcion.

  Note the distinction between formatter *lookup* functions and formatter
  functions here.
  """
  def MoreFormatters(formatter_name):
    for lookup_func in lookup_func_list:
      formatter_func = lookup_func(formatter_name)
      if formatter_func is not None:
        return formatter_func

  return MoreFormatters
def LookupChain ( lookup_func_list ) : def MoreFormatters ( formatter_name ) : for lookup_func in lookup_func_list : formatter_func = lookup_func ( formatter_name ) if formatter_func is not None : return formatter_func return MoreFormatters
Returns a *function* suitable for passing as the more_formatters argument
  to Template.

  NOTE: In Java, this would be implemented using the 'Composite' pattern.  A
  *list* of formatter lookup function behaves the same as a *single* formatter
  lookup funcion.

  Note the distinction between formatter *lookup* functions and formatter
  functions here.