[Python-checkins] CVS: python/dist/src/Objects object.c,2.124.4.2,2.124.4.3
Guido van Rossum
gvanrossum@users.sourceforge.net
Fri, 27 Apr 2001 14:32:13 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.35.4.1,2.35.4.2 descrobject.c,1.1.2.2,1.1.2.3 dictobject.c,2.80.2.1,2.80.2.2 fileobject.c,2.112.2.1,2.112.2.2 frameobject.c,2.49.4.1,2.49.4.2 listobject.c,2.92.6.1,2.92.6.2 methodobject.c,2.33.8.2,2.33.8.3 object.c,2.124.4.1,2.124.4.2 rangeobject.c,2.24.6.1,2.24.6.2 sliceobject.c,2.7.4.1,2.7.4.2 stringobject.c,2.103.2.1,2.103.2.2 typeobject.c,2.16.8.1,2.16.8.2 unicodeobject.c,2.87.2.1,2.87.2.2
- Next message: [Python-checkins] CVS: python/dist/src/Objects object.c,2.124,2.125
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv5972
Modified Files:
Tag: descr-branch
object.c
Log Message:
Fix a very old flaw in PyObject_Print(). Amazing! When an object
type defines tp_str but not tp_repr, 'print x' to a real file
object would not call the tp_str slot but rather print a default style
representation: <foo object at 0x....>. This even though 'print x' to
a file-like-object would correctly call the tp_str slot.
Index: object.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
retrieving revision 2.124.4.2
retrieving revision 2.124.4.3
diff -C2 -r2.124.4.2 -r2.124.4.3
*** object.c 2001/04/27 18:04:51 2.124.4.2
--- object.c 2001/04/27 21:32:11 2.124.4.3
***************
*** 197,201 ****
op->ob_refcnt, op);
else if (op->ob_type->tp_print == NULL) {
! if (op->ob_type->tp_repr == NULL) {
fprintf(fp, "<%s object at %p>",
op->ob_type->tp_name, op);
--- 197,204 ----
op->ob_refcnt, op);
else if (op->ob_type->tp_print == NULL) {
! if ((flags & Py_PRINT_RAW)
! ? (op->ob_type->tp_str == NULL)
! : (op->ob_type->tp_repr == NULL))
! {
fprintf(fp, "<%s object at %p>",
op->ob_type->tp_name, op);
- Previous message: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.35.4.1,2.35.4.2 descrobject.c,1.1.2.2,1.1.2.3 dictobject.c,2.80.2.1,2.80.2.2 fileobject.c,2.112.2.1,2.112.2.2 frameobject.c,2.49.4.1,2.49.4.2 listobject.c,2.92.6.1,2.92.6.2 methodobject.c,2.33.8.2,2.33.8.3 object.c,2.124.4.1,2.124.4.2 rangeobject.c,2.24.6.1,2.24.6.2 sliceobject.c,2.7.4.1,2.7.4.2 stringobject.c,2.103.2.1,2.103.2.2 typeobject.c,2.16.8.1,2.16.8.2 unicodeobject.c,2.87.2.1,2.87.2.2
- Next message: [Python-checkins] CVS: python/dist/src/Objects object.c,2.124,2.125
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]