]> granicus.if.org Git - python/commit
wrap_cmpfunc(): added a safety check for the __cmp__ wrapper. We can
authorGuido van Rossum <guido@python.org>
Tue, 18 Sep 2001 20:03:57 +0000 (20:03 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 18 Sep 2001 20:03:57 +0000 (20:03 +0000)
commitceccae5365276f3b8858deb3f49815ff8e8f0b8c
tree2bb48e16f5630a218c739203d25cc1609d3ddd41
parent21009b9c6fc40b25fcb30ee60d6108f235733e40
wrap_cmpfunc(): added a safety check for the __cmp__ wrapper.  We can
only safely call a type's tp_compare slot if the second argument is
also an instance of the same type.  I hate to think what
e.g. int_compare() would do with a second argument that's a float!
Objects/typeobject.c