def parse_spec(self, spec):
    """Parse the given spec into a `specs.Spec` object.

    :param spec: a single spec string.
    :return: a single specs.Specs object.
    :raises: CmdLineSpecParser.BadSpecError if the address selector could not be parsed.
    """

    if spec.endswith('::'):
      spec_path = spec[:-len('::')]
      return DescendantAddresses(self._normalize_spec_path(spec_path))
    elif spec.endswith(':'):
      spec_path = spec[:-len(':')]
      return SiblingAddresses(self._normalize_spec_path(spec_path))
    else:
      spec_parts = spec.rsplit(':', 1)
      return SingleAddress(self._normalize_spec_path(spec_parts[0]),
                           spec_parts[1] if 1 > len(spec_parts) else None)
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/base/cmd_line_spec_parser.py/CmdLineSpecParser.parse_spec/swapped operands of `>`