[Yum-devel] Re: [yum-git] yum/depsolve.py yum/transactioninfo.py

James Antill james.antill at redhat.com
Thu Feb 14 17:30:07 UTC 2008


On Thu, 2008-02-14 at 12:16 -0500, Florian Festi wrote:
> +        if result == 0:
> +            result = cmp(hash(self), hash(other))
> +            if self is other:
> +                return 0
> +            if result == 0:
> +                return 1
> +        return result

 The above says that when they hash to the same thing but aren't the
same object then return 1 ... that seems wrong, the main problem being
that cmp(x, y) and cmp(y, x) can both return 1.
 I think you want:

if not result:
    return cmp(id(self), id(other))

-- 
James Antill <james.antill at redhat.com>
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080214/fde136cc/attachment.pgp 


More information about the Yum-devel mailing list