Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
2010-05-09 14:46:46 +00:00
Antoine Pitrou
653dece278
Issue #4426 : The UTF-7 decoder was too strict and didn't accept some legal sequences.
...
Patch by Nick Barnes and Victor Stinner.
2009-05-04 18:32:32 +00:00
Marc-André Lemburg
3741bfdd3c
Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration
...
into the extern "C" section.
Add a few more comments and apply some minor edits to make the file contents
fit the original structure again.
2009-01-05 19:43:35 +00:00
Alexandre Vassalotti
a925bed208
Sort UCS-2/UCS-4 name mangling list.
2008-12-28 02:10:35 +00:00
Alexandre Vassalotti
d8f8ee4af8
Fix name mangling of PyUnicode_ClearFreeList.
2008-12-28 01:52:58 +00:00
Amaury Forgeot d'Arc
07d539d08b
#4122 : On Windows, Py_UNICODE_ISSPACE cannot be used in an extension module:
...
compilation fails with "undefined reference to _Py_ascii_whitespace"
Will backport to 2.6.
2008-10-14 21:47:22 +00:00
Eric Smith
dc13b79a38
Refactor and clean up str.format() code (and helpers) in advance of optimizations.
2008-05-30 18:10:04 +00:00
Christian Heimes
3b718a79af
Implemented Martin's suggestion to clear the free lists during the garbage collection of the highest generation.
2008-02-14 12:47:33 +00:00
Christian Heimes
4d4f270941
Patch #1970 by Antoine Pitrou: Speedup unicode whitespace and linebreak detection. The speedup is about 25% for split() (571 / 457 usec) and 35% (175 / 127 usec )for splitlines()
2008-01-30 11:32:37 +00:00
Neal Norwitz
cfb41c4985
Add stdarg include for va_list to get this to compile on cygwin
2008-01-27 07:41:33 +00:00
Christian Heimes
7f39c9fcbb
Backport of several functions from Python 3.0 to 2.6 including PyUnicode_FromString, PyUnicode_Format and PyLong_From/AsSsize_t. The functions are partly required for the backport of the bytearray type and _fileio module. They should also make it easier to port C to 3.0.
...
First chapter of the Python 3.0 io framework back port: _fileio
The next step depends on a working bytearray type which itself depends on a backport of the nwe buffer API.
2008-01-25 12:18:43 +00:00
Christian Heimes
e93237dfcc
#1629 : Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
2007-12-19 02:37:44 +00:00
Amaury Forgeot d'Arc
5087980c1e
The incremental decoder for utf-7 must preserve its state between calls.
...
Solves issue1460.
Might not be a backport candidate: a new API function was added,
and some code may rely on details in utf-7.py.
2007-11-20 23:31:27 +00:00
Walter Dörwald
6e39080649
Backport r57105 and r57145 from the py3k branch: UTF-32 codecs.
2007-08-17 16:41:28 +00:00
Martin v. Löwis
6819210b9e
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
...
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00
Neal Norwitz
ee3a1b5244
Variation of patch # 1624059 to speed up checking if an object is a subclass
...
of some of the common builtin types.
Use a bit in tp_flags for each common builtin type. Check the bit
to determine if any instance is a subclass of these common types.
The check avoids a function call and O(n) search of the base classes.
The check is done in the various Py*_Check macros rather than calling
PyType_IsSubtype().
All the bits are set in tp_flags when the type is declared
in the Objects/*object.c files because PyType_Ready() is not called
for all the types. Should PyType_Ready() be called for all types?
If so and the change is made, the changes to the Objects/*object.c files
can be reverted (remove setting the tp_flags). Objects/typeobject.c
would also have to be modified to add conditions
for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
2007-02-25 19:44:48 +00:00
Marc-André Lemburg
040f76b79c
Slightly revised version of patch #1538956 :
...
Replace UnicodeDecodeErrors raised during == and !=
compares of Unicode and other objects with a new
UnicodeWarning.
All other comparisons continue to raise exceptions.
Exceptions other than UnicodeDecodeErrors are also left
untouched.
2006-08-14 10:55:19 +00:00
Martin v. Löwis
d825143be1
Patch #1455898 : Incremental mode for "mbcs" codec.
2006-06-14 05:21:04 +00:00
Martin v. Löwis
3f767795f6
Patch #1359618 : Speed-up charmap encoder.
2006-06-04 19:36:28 +00:00
Fredrik Lundh
80f8e80c15
needforspeed: added Py_MEMCPY macro (currently tuned for Visual C only),
...
and use it for string copy operations. this gives a 20% speedup on some
string benchmarks.
2006-05-28 12:06:46 +00:00
Fredrik Lundh
b3167cbcd7
needforspeed: added rpartition implementation
2006-05-26 18:15:38 +00:00
Fredrik Lundh
06a69dd8ff
needforspeed: partition implementation, part two.
...
feel free to improve the documentation and the docstrings.
2006-05-26 08:54:28 +00:00
Fredrik Lundh
3d885e0195
needforspeed: check first *and* last character before doing a full memcmp
2006-05-23 10:10:57 +00:00
Fredrik Lundh
8a8e05a2b9
needforspeed: use memcpy for "long" strings; use a better algorithm
...
for long repeats.
2006-05-22 17:12:58 +00:00
Fredrik Lundh
f1d60a5384
needforspeed: speed up unicode repeat, unicode string copy
2006-05-22 16:29:30 +00:00