def getVersions(self):
    '        Returns list of ::Version:: objects.\n\n        This is the final list based on the version information in this font object as\n        well as in its parent ::Family:: object. Please read the section about\n        [versioning](#versioning) above.\n        '
    if (not self.hasVersionInformation()):
        raise ValueError(('%s has no version information, and neither has its family %s. Either one needs to carry version information.' % (self, self.parent)))

    def compare(a, b):
        return semver.VersionInfo.parse(makeSemVer(a.number)).compare(makeSemVer(b.number))
    versions = []
    haveVersionNumbers = []
    for version in self.versions:
        versions.append(version)
        haveVersionNumbers.append(makeSemVer(version.number))
    for version in self.parent.versions:
        if (version.number not in haveVersionNumbers):
            versions.append(version)
            haveVersionNumbers.append(makeSemVer(version.number))
    versions = sorted(versions, key=functools.cmp_to_key(compare))
    return versions
Returns list of ::Version:: objects.

This is the final list based on the version information in this font object as
well as in its parent ::Family:: object. Please read the section about
[versioning](#versioning) above.
def getVersions(self):
    '        Returns list of ::Version:: objects.\n\n        This is the final list based on the version information in this font object as\n        well as in its parent ::Family:: object. Please read the section about\n        [versioning](#versioning) above.\n        '
    if (not self.hasVersionInformation()):
        raise ValueError(('%s has no version information, and neither has its family %s. Either one needs to carry version information.' % (self, self.parent)))

    def compare(a, b):
        return semver.VersionInfo.parse(makeSemVer(a.number)).compare(makeSemVer(b.number))
    versions = []
    haveVersionNumbers = []
    for version in self.versions:
        versions.append(version)
        haveVersionNumbers.append(makeSemVer(version.number))
    for version in self.parent.versions:
        if (version.number not in haveVersionNumbers):
            versions.append(version)
            haveVersionNumbers.append(makeSemVer(version.number))
    versions = sorted(versions, key=functools.cmp_to_key(compare))
    return versions