Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 uid=99(nobody) gid=98(nobody) groups=98(nobody) Safe-mode: OFF (not secure) /opt/doc/python-2.3.4/html/Python-Docs-2.3.4/ext/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 2.2.4 Object Comparison
cmpfunc tp_compare;
The tp_compare handler is called when comparisons are needed
and the object does not implement the specific rich comparison method
which matches the requested comparison. (It is always used if defined
and the PyObject_Compare() or PyObject_Cmp()
functions are used, or if cmp() is used from Python.)
It is analogous to the __cmp__() method. This function
should return A tp_compare handler may raise an exception. In this case it should return a negative value. The caller has to test for the exception using PyErr_Occurred(). Here is a sample implementation:
static int
newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2)
{
long result;
if (obj1->obj_UnderlyingDatatypePtr->size <
obj2->obj_UnderlyingDatatypePtr->size) {
result = -1;
}
else if (obj1->obj_UnderlyingDatatypePtr->size >
obj2->obj_UnderlyingDatatypePtr->size) {
result = 1;
}
else {
result = 0;
}
return result;
}
See About this document... for information on suggesting changes. |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0045 ]-- |