]> granicus.if.org Git - python/commit
PyString_FromFormat() and PyString_FromFormatV(): Largely ripped from
authorBarry Warsaw <barry@python.org>
Fri, 24 Aug 2001 18:32:06 +0000 (18:32 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 24 Aug 2001 18:32:06 +0000 (18:32 +0000)
commitdadace004b4b94dcc4437bafc9c8407fbb1bed74
treeb381d7e83a12d2a452c0c8c70da5acd26b8c522a
parent16c018d2d24e7b3366edda53baf85fa3a4a21f1e
PyString_FromFormat() and PyString_FromFormatV(): Largely ripped from
    PyErr_Format() these new C API methods can be used instead of
    sprintf()'s into hardcoded char* buffers.  This allows us to fix
    many situation where long package, module, or class names get
    truncated in reprs.

    PyString_FromFormat() is the varargs variety.
    PyString_FromFormatV() is the va_list variety

    Original PyErr_Format() code was modified to allow %p and %ld
    expansions.

    Many reprs were converted to this, checkins coming soo.  Not
    changed: complex_repr(), float_repr(), float_print(), float_str(),
    int_repr().  There may be other candidates not yet converted.

    Closes patch #454743.
Include/stringobject.h
Objects/stringobject.c