docs: def lookup(values, name=None):
      """
      Creates the grammar for a Lookup (L) field, accepting only values from a
      list.
  
      Like in the Alphanumeric field, the result will be stripped of all heading
      and trailing whitespaces.
  
      :param values: values allowed
      :param name: name for the field
      :return: grammar for the lookup field
      """
      if name is None:
          name = 'Lookup Field'
  
      if values is None:
          raise ValueError('The values can no be None')
  
      # TODO: This should not be needed, it is just a patch. Fix this.
      try:
          v = values.asList()
          values = v
      except AttributeError:
          values = values
  
      # Only the specified values are allowed
      lookup_field = pp.oneOf(values)
  
      lookup_field.setName(name)
  
      lookup_field.setParseAction(lambda s: s[0].strip())
  
      lookup_field.leaveWhitespace()
  
      return lookup_field