diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2023-01-12 21:48:37 -0500 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2023-01-12 21:48:37 -0500 |
commit | b7052c5f520f272cf8217cb23fca2ddd1c6fcec4 (patch) | |
tree | 57e1dfe6478b038fddf04bf43426930a1e602152 /paramiko | |
parent | a198ebd56c5eafd573e98f912bcf8aeec0c7e7d9 (diff) | |
download | paramiko-b7052c5f520f272cf8217cb23fca2ddd1c6fcec4.tar.gz |
No more PKey.__cmp__
Diffstat (limited to 'paramiko')
-rw-r--r-- | paramiko/pkey.py | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py index d5ea27b6..2d189d9a 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -122,24 +122,6 @@ class PKey(object): def __bytes__(self): return self.asbytes() - # noinspection PyUnresolvedReferences - # TODO: The comparison functions should be removed as per: - # https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons - def __cmp__(self, other): - """ - Compare this key to another. Returns 0 if this key is equivalent to - the given key, or non-0 if they are different. Only the public parts - of the key are compared, so a public key will compare equal to its - corresponding private key. - - :param .PKey other: key to compare to. - """ - hs = hash(self) - ho = hash(other) - if hs != ho: - return cmp(hs, ho) # noqa - return cmp(self.asbytes(), other.asbytes()) # noqa - def __eq__(self, other): return isinstance(other, PKey) and self._fields == other._fields |