def METHOD_NAME(self, other):
    if not isinstance(other, (basestring, NumpyVersion)):
        raise ValueError("Invalid object to compare with NumpyVersion.")
    if isinstance(other, basestring):
        other = NumpyVersion(other)
    vercmp = self._compare_version(other)
    if vercmp == 0:
        # Same x.y.z version, check for alpha/beta/rc
        vercmp = self._compare_pre_release(other)
        if vercmp == 0:
            # Same version and same pre-release, check if dev version
            if self.is_devversion is other.is_devversion:
                vercmp = 0
            elif self.is_devversion:
                vercmp = -1
            else:
                vercmp = 1
    return vercmp