code: def contains_only(self, elements):
          
          for element in self._subject:
              if element not in elements:
                  raise self._error_factory(_format("Expected {} to have only {}, but it contains {}",
                                                    self._subject, elements, element))
          self.contains_all_of(elements)
          return ChainInspector(self._subject)
docs: Ensures :attr:`subject` contains all of *elements*, which must be an iterable, and no other items.