diff options
author | Guido van Rossum <guido@python.org> | 2001-05-01 16:53:37 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-05-01 16:53:37 (GMT) |
commit | 4f288ab7d6b386e223a187523daf894e012f8cfd (patch) | |
tree | baf04dfbdeaab91767af7ddbc3e146cc1fdbac2c /Objects/iterobject.c | |
parent | 189f1df3018885335bc9e719a96e891e3812ce1a (diff) | |
download | cpython-4f288ab7d6b386e223a187523daf894e012f8cfd.zip cpython-4f288ab7d6b386e223a187523daf894e012f8cfd.tar.gz cpython-4f288ab7d6b386e223a187523daf894e012f8cfd.tar.bz2 |
Printing objects to a real file still wasn't done right: if the
object's type didn't define tp_print, there were still cases where the
full "print uses str() which falls back to repr()" semantics weren't
honored. This resulted in
>>> print None
<None object at 0x80bd674>
>>> print type(u'')
<type object at 0x80c0a80>
Fixed this by always using the appropriate PyObject_Repr() or
PyObject_Str() call, rather than trying to emulate what they would do.
Also simplified PyObject_Str() to always fall back on PyObject_Repr()
when tp_str is not defined (rather than making an extra check for
instances with a __str__ method). And got rid of the special case for
strings.
Diffstat (limited to 'Objects/iterobject.c')
0 files changed, 0 insertions, 0 deletions