code: func ParseVersion(s string) (Version, error) {
  	var v Version
  	if s == "" {
  		return v, nil
  	}
  
  	match := canonicalVersionRE.FindStringSubmatch(s)
  	if match == nil {
  		return v, errors.Reason("non-canonical Python version string: %q", s).Err()
  	}
  	parts := strings.Split(match[2], ".")
  
  	// Values are expected to parse, and will panic otherwise. This is safe
  	// because the value has already been determined to be canonical above.
  	mustParseVersion := func(value string) int {
  		version, err := strconv.Atoi(value)
  		if err != nil {
  			panic(fmt.Sprintf("invalid number value %q: %s", value, err))
  		}
  		return version
  	}
  
  	// Regexp match guarantees that "parts" will have at least one component, and
  	// that all components are well-formed numbers.
  	if len(parts) >= 3 {
  		v.Patch = mustParseVersion(parts[2])
  	}
  	if len(parts) >= 2 {
  		v.Minor = mustParseVersion(parts[1])
  	}
  	v.Major = mustParseVersion(parts[0])
  	if v.IsZero() {
  		return v, errors.Reason("version is incomplete").Err()
  	}
  	return v, nil
  }
docs: // ParseVersion parses a Python version from a version string (e.g., "1.2.3").