• Guido van Rossum's avatar
    Printing objects to a real file still wasn't done right: if the · 4f288ab7
    Guido van Rossum yazdı
    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.
    4f288ab7
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
setup.py Loading commit data...