summaryrefslogtreecommitdiff
path: root/Include/stringobject.h
AgeCommit message (Collapse)AuthorLines
2001-10-23Add function attributes that allow GCC to check the arguments of printf-likeNeil Schemenauer-2/+4
functions.
2001-09-11More on SF bug [#460020] bug or feature: unicode() and subclasses.Tim Peters-0/+1
Repaired str(i) to return a genuine string when i is an instance of a str subclass. New PyString_CheckExact() macro.
2001-08-30Make the Py<type>_Check() macro use PyObject_TypeCheck().Guido van Rossum-1/+1
2001-08-24PyString_FromFormat() and PyString_FromFormatV(): Largely ripped fromBarry Warsaw-0/+4
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.
2001-06-16SF bug 433228: repr(list) woes when len(list) big.Tim Peters-0/+4
Gave Python linear-time repr() implementations for dicts, lists, strings. This means, e.g., that repr(range(50000)) is no longer 50x slower than pprint.pprint() in 2.2 <wink>. I don't consider this a bugfix candidate, as it's a performance boost. Added _PyString_Join() to the internal string API. If we want that in the public API, fine, but then it requires runtime error checks instead of asserts.
2001-05-24Patch #424335: Implement string_richcompare, remove string_compare.Martin v. Löwis-0/+1
Use new _PyString_Eq in lookdict_string.
2001-05-15This patch changes the way the string .encode() method works slightlyMarc-André Lemburg-3/+40
and introduces a new method .decode(). The major change is that strg.encode() will no longer try to convert Unicode returns from the codec into a string, but instead pass along the Unicode object as-is. The same is now true for all other codec return types. The underlying C APIs were changed accordingly. Note that even though this does have the potential of breaking existing code, the chances are low since conversion from Unicode previously took place using the default encoding which is normally set to ASCII rendering this auto-conversion mechanism useless for most Unicode encodings. The good news is that you can now use .encode() and .decode() with much greater ease and that the door was opened for better accessibility of the builtin codecs. As demonstration of the new feature, the patch includes a few new codecs which allow string to string encoding and decoding (rot13, hex, zip, uu, base64). Written by Marc-Andre Lemburg. Copyright assigned to the PSF.
2001-02-23_Py_ReleaseInternedStrings(): Private API function to decref andBarry Warsaw-0/+2
release the interned string dictionary. This is useful for memory use debugging because it eliminates a huge source of noise from the reports. Only defined when INTERN_STRINGS is defined.
2000-09-21Derived from Martin's SF patch 110609: support unbounded ints in ↵Tim Peters-0/+2
%d,i,u,x,X,o formats. Note a curious extension to the std C rules: x, X and o formatting can never produce a sign character in C, so the '+' and ' ' flags are meaningless for them. But unbounded ints *can* produce a sign character under these conversions (no fixed- width bitstring is wide enough to hold all negative values in 2's-comp form). So these flags become meaningful in Python when formatting a Python long which is too big to fit in a C long. This required shuffling around existing code, which hacked x and X conversions to death when both the '#' and '0' flags were specified: the hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or '+' flags too, since signs were always meaningless before for x and X conversions. Isomorphic shuffling was required in unicodeobject.c. Also added dozens of non-trivial new unbounded-int test cases to test_format.py.
2000-09-19This patch adds a new Python C API called PyString_AsStringAndSize()Marc-André Lemburg-0/+15
which implements the automatic conversion from Unicode to a string object using the default encoding. The new API is then put to use to have eval() and exec accept Unicode objects as code parameter. This closes bugs #110924 and #113890. As side-effect, the traditional C APIs PyString_Size() and PyString_AsString() will also accept Unicode objects as parameters.
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-07-09ANSI-fication and Py_PROTO extermination.Fred Drake-20/+20
2000-07-06Added prototypes for the new codec APIs for strings. These APIsMarc-André Lemburg-0/+31
match the ones in the Unicode implementation, but were extended to be able to reuse the existing Unicode codecs for string purposes too. Conversion from string to Unicode and back are done using the default encoding.
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
1998-12-04Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum-10/+10
1997-01-18Two speedup hacks. Caching the hash saves recalculation of a string'sGuido van Rossum-3/+23
hash value. Interning strings (which requires hash caching) tries to ensure that only one string object with a given value exists, so equality tests are one pointer comparison. Together, these can speed the interpreter up by as much as 20%. Each costs the size of a long or pointer per string object. In addition, interned strings live until the end of times. If you are concerned about memory footprint, simply comment the #define out here (and rebuild everything!).
1997-01-06added PyString_GET_SIZE macroBarry Warsaw-1/+2
for both PyString_GET_SIZE and PyString_AS_STRING, cast first argument to a PyStringObject*
1996-12-10Add const to error and newstring functionsGuido van Rossum-2/+2
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19
1996-07-30Turn on CACHE_HASH, for 2% speedier dict lookupsGuido van Rossum-0/+3
1995-02-27make the type a parameter of the DL_IMPORT macro, for Borland CGuido van Rossum-1/+1
1995-01-17new names for lots of new functionsGuido van Rossum-3/+1
1995-01-12The great renaming, phase two: all header files have been updated toGuido van Rossum-14/+14
use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
1995-01-04Added 1995 copyright.Guido van Rossum-3/+3
object.h: made sizes and refcnts signed ints. stringobject.h: make getstrsize() signed int. methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
1994-08-18Changes for dynamic linking under NTGuido van Rossum-1/+1
1994-08-01Merge alpha100 branch back to main trunkGuido van Rossum-1/+2
1993-10-22Several optimizations and speed improvements.Sjoerd Mullender-0/+3
cstubs: Use Matrix type instead of float[4][4].
1993-07-28* Added support for X11 modules.Guido van Rossum-0/+11
* Makefile: change location of FORMS library. * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not) * Almost all .h files: added CPP magic to avoid duplicate inclusions and to support inclusion from C++.
1993-03-16* Changed many files to use mkvalue() instead of newtupleobject().Guido van Rossum-2/+3
* Fixcprt.py: added [-y file] option, do only files younger than file. * modsupport.[ch]: added vmkvalue(). * intobject.c: use mkvalue(). * stringobject.c: added "formatstring"; renamed string* to string_*; ceval.c: call formatstring for string % value. * longobject.c: close memory leak in divmod. * parsetok.c: set result node to NULL when returning an error.
1992-04-05Copyright for 1992 addedGuido van Rossum-1/+1
1991-02-19Added copyright notice.Guido van Rossum-0/+24
1990-10-14Initial revisionGuido van Rossum-0/+39