summaryrefslogtreecommitdiffstats
path: root/Modules/stropmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* In atoi(), don't use isxdigit() to test whether the last characterGuido van Rossum1999-02-221-1/+1
| | | | | | converted was a "digit" -- use isalnum(). This test is there only to guard against "+" or "-" being interpreted as a valid int literal. Reported by Takahiro Nakayama.
* expandtabs__doc__: blank line which was not terminated with \n\ causedBarry Warsaw1999-01-261-1/+0
| | | | the SunPro C compiler to choke. Removed this redundant line.
* A gift from Fredrik Lundh: fast C implementation of expandtabs().Guido van Rossum1999-01-251-0/+75
| | | | | I've reformatted it, added a few comments, a test for tabsize <= 0, and used the AS_STRING macro.
* Remove prototypes for PyOS_strto[u]l -- Chris Herborth.Guido van Rossum1998-12-101-3/+0
|
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Add a missing DECREF in an error exit. Submitted by Jonathan Giddy.Guido van Rossum1998-10-191-0/+1
|
* Use the t# format where appropriate. Greg Stein.Guido van Rossum1998-10-081-13/+13
|
* Make gcc -Wall happy.Guido van Rossum1998-10-071-1/+1
|
* Andrew Dalke's implementation of string.count().Guido van Rossum1998-10-061-0/+47
|
* Better error messages when raising ValueError for int literals. (TheGuido van Rossum1998-08-041-8/+3
| | | | | previous version of this code would not show the offending input, even though there was code that attempted this.)
* Make sure that at least one digit has been consumed in atoi().Guido van Rossum1998-07-251-0/+4
|
* Make sure that no use of a function pointer gotten from aGuido van Rossum1998-05-221-3/+5
| | | | | tp_as_sequence or tp_as_mapping structure is made without checking it for NULL first.
* strop_replace(): balk if the pattern string is empty.Guido van Rossum1998-05-141-0/+4
|
* Check for boundary errors in [r]find -- find("x", "", 2) should return -1.Guido van Rossum1998-03-241-2/+2
|
* Forgot to return NULL in joinfields() when a type error was detectedGuido van Rossum1998-02-061-1/+3
| | | | in one of the sequence items.
* Oops, big glitch. Charles had put a 1 in the column for argument listGuido van Rossum1997-12-301-8/+8
| | | | | | | | type for all functions. However many function call PyArg_Parse() and need a 0. This is so that when they didn't change anything, the can do Py_INCREF(args); return args. Reverted this back. For atof(), there's no reason not to use PyArg_ParseTuple(), so I changed the code (atoi and atol already used that).
* Oops, the last checkin left a blank line in a string literal.Guido van Rossum1997-12-301-1/+1
|
* Minor editing corrections.Guido van Rossum1997-12-291-5/+6
|
* Added doc string, provided by Charles Waldman (with some reformattingGuido van Rossum1997-12-291-29/+162
| | | | and a little editing my me).
* split_whitespace(): Make sure delimiter is stripped from the beginningBarry Warsaw1997-12-021-1/+4
| | | | | of the remainder item (last item in list) when maxsplit is < the number of occurrences.
* mymemreplace(), strop_replace(): Add support for optional 4th argumentBarry Warsaw1997-11-291-4/+12
| | | | | | | | maxsplit which is implemented in string.py but wasn't here. The reference manual doesn't define what happens when maxsplit is negative or larger than the number of occurrences, but in either case, I implemented this as all get replaced. Default value is zero which replaces all occurrences.
* Keep gcc -Wall happy.Guido van Rossum1997-04-291-1/+1
|
* Added replace() implementation by Perry Stoll (debugged and reformatted by me).Guido van Rossum1997-04-021-1/+167
|
* Add optional 4th argument to [r]find and [r]index (end of slice).Guido van Rossum1997-03-141-9/+27
|
* Changes for Lee Busby's SIGFPE patch set.Guido van Rossum1997-02-141-0/+2
| | | | | Two new modules fpectl and fpetest. Surround various and sundry f.p. operations with PyFPE_*_PROTECT macros.
* New strop_joinfields implementation, highly optimized for Lists. AllBarry Warsaw1997-01-061-60/+82
| | | | | | other sequences use the Sequence protocol from the abstract API. The algorithm has changed so that only one pass through the sequences are made.
* Rewrote translate() as follows:Guido van Rossum1997-01-061-28/+52
| | | | | | | | | | | | - 'delete' is a C++ keyword; use 'del_table' instead - apply Py_CHARMASK() to del_table[i] before using it as an index *** this fixes a bug that was just reported on the list *** - if the translation didn't make any changes, INCREF and return the original string - when del_table is empty or omitted, don't copy the translation table to a table of ints (should be a bit faster) Rewrote maketrans() to avoid copying the table (2-3% faster).
* strop_upper(), strop_lower(): shared code version caused to much of aBarry Warsaw1997-01-031-27/+65
| | | | | | | performance hit. Urg. Reverted. strop_joinfields(): re-instate optimizations for lists and tuples, but support arbitrary other kinds of sequences as well.
* Several changes:Barry Warsaw1997-01-031-142/+106
| | | | | | | | | | | | | | | | | | | | | | | - split_whitespace(): slightly better memory ref handling when errors occur. - strop_joinfields(): First argument can now be any sequence-protocol conformant object. - strop_find(), strop_rfind(): Use PyArg_ParseTuple for optional arguments - strop_lower(), strop_upper(): Factor logic into a common function do_casechange(). - strop_atoi(), strop_atol(): Use PyArg_ParseTuple. - strop_maketrans(): arguments used to be optional, although the documentation doesn't reflect this. Make the source conform to the docs. Arguments are required, but two empty strings will return the identity translation table. - General pass fixing up formatting, and checking for return values.
* Greatly renamed.Barry Warsaw1996-12-091-178/+181
|
* Keep gcc -Wall happy.Guido van Rossum1996-12-051-3/+3
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Replace all uses of strncmp (in split, find, rfind) with memcmp, soGuido van Rossum1996-10-041-3/+3
| | | | | embedded \0 in the delimiter is handled properly. Thanks to Sjoerd for suggesting this.
* Add text of argument to errors for atoi(), atol(), atof().Guido van Rossum1996-09-111-5/+25
|
* Raise ValueError on empty string passed into atoi(), atol(), atof().Guido van Rossum1996-08-211-0/+12
|
* Remove some unused variables.Guido van Rossum1996-08-191-9/+0
|
* Added lstrip() and rstrip().Guido van Rossum1996-08-081-17/+93
| | | | | | Extended split() (and hence splitfields(), which is the same function) to support an optional third parameter giving the maximum number of delimiters to parse.
* Added 3rd optional argument to translate(), a string of characters to delete.Guido van Rossum1996-07-231-11/+60
| | | | Added maketrans(), a utility to create a translation table.
* Test for zero-length argument in capitalize().Guido van Rossum1996-06-171-1/+1
|
* added capitalize()Guido van Rossum1996-06-121-0/+45
|
* added strop.translate(s, table)Guido van Rossum1995-09-131-0/+30
|
* unified join(fields), split(fields)Guido van Rossum1995-05-031-12/+20
|
* fix stupid bug in strip and splitGuido van Rossum1995-02-141-2/+2
|
* use Py_CHARMASKGuido van Rossum1995-02-101-14/+10
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
| | | | | Setup.in: clarified Tk comments somewhat. structmodule.c: use memcpy() instead of double precision assignment.
* * various modules: #include "Python.h" and remove most remporaryGuido van Rossum1994-09-141-8/+4
| | | | renaming hacks
* * Modules/stropmodule.c: implement find/rfind instead ofGuido van Rossum1994-08-171-8/+6
| | | | | index/rindex (raising and catching an exception is much more expensive than returning and testing -1)
* * Modules/{Setup.in,Makefile.pre.in}: renamed some modules toGuido van Rossum1994-08-051-1/+1
| | | | | | | | | | shorter names (dropped the "module" from the name): sunaudiodev, imgformat, audioop, imageop, imgfile * Modules/stropmodule.c (strop_rindex): make rindex('abc', '') do the right thing (i.e. return 3 instead of 0) * Modules/socketmodule.c: disabled allowbroadcast() socket method
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-7/+108
|
* Fix memory leaks in join & joinfieldsGuido van Rossum1993-11-051-11/+25
|