* mpzmodule.c: removed redundant mpz_print function.
* object.[ch], bltinmodule.c, fileobject.c: changed str() to call
strobject() which calls an object's __str__ method if it has one.
strobject() is also called by writeobject() when PRINT_RAW is passed.
* ceval.c: rationalize code for PRINT_ITEM (no change in function!)
* funcobject.c, codeobject.c: added compare and hash functionality.
Functions with identical code objects and the same global dictionary are
equal. Code objects are equal when their code, constants list and names
list are identical (i.e. the filename and code name don't count).
(hash doesn't work yet since the constants are in a list and lists can't
be hashed -- suppose this should really be done with a tuple now we have
resizetuple!)
diff --git a/Modules/mpzmodule.c b/Modules/mpzmodule.c
index a3e903e..5ff0801 100644
--- a/Modules/mpzmodule.c
+++ b/Modules/mpzmodule.c
@@ -265,24 +265,6 @@
DEL(mpzp);
} /* mpz_dealloc() */
-/* ARGSUSED */
-static int
-mpz_print(v, fp, flags)
- object *v;
- FILE *fp;
- int flags; /* Not used but required by interface */
-{
- stringobject *str
- = (stringobject *)mpz_format(v, 10, (unsigned char)1);
-
- if (str == NULL)
- return -1;
-
- fputs(GETSTRINGVALUE(str), fp);
- DECREF(str);
- return 0;
-} /* mpz_print() */
-
/* pointers to frequently used values 0, 1 and -1 */
static mpzobject *mpz_value_zero, *mpz_value_one, *mpz_value_mone;
@@ -1658,7 +1640,7 @@
0, /*tp_itemsize*/
/* methods */
mpz_dealloc, /*tp_dealloc*/
- mpz_print, /*tp_print*/
+ 0, /*tp_print*/
mpz_getattr, /*tp_getattr*/
0, /*tp_setattr*/
mpz_compare, /*tp_compare*/