[Python-Dev] Detecting tp_compare / tp_richcompare from Python
Tres Seaver
tseaver at palladion.com
Thu Nov 8 20:51:54 CET 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/08/2012 12:59 PM, Guido van Rossum wrote:
> In Python, you can write
>
> if C.__eq__ == object.__eq__: print('class C does not override
> __eq__')
>
> Does that help?
That works in Python3, but not in Python2 -- methodwrappers don't compare
equal the same way slotwrappers do :(. I still need to straddle (back to
Python 2.6.
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iEYEARECAAYFAlCcDVoACgkQ+gerLs4ltQ49kwCgtBJX1oyi5cudZeE4LBEdcAmO
aTAAn0jL56d3eK/sDUD3G7zzZ/ZdQH4W
=NG86
-----END PGP SIGNATURE-----
More information about the Python-Dev
mailing list