Antoine Pitrou
f34a0cdc6c
Issue #10227 : Add an allocation cache for a single slice object.
Patch by Stefan Behnel.
14 years ago
Victor Stinner
6f9568bb1f
Fix misused of "PyUnicodeObject" structure name in unicodeobject.h
14 years ago
Antoine Pitrou
9a812cbc89
Issue #13389 : Full garbage collection passes now clear the freelists for
list and dict objects. They already cleared other freelists in the
interpreter.
14 years ago
Martin v. Löwis
1db7c13be1
Port encoders from Py_UNICODE API to unicode object API.
14 years ago
Martin v. Löwis
d10759f6ed
Make _PyUnicode_FromId return borrowed references.
http://mail.python.org/pipermail/python-dev/2011-November/114347.html
14 years ago
Victor Stinner
e30c0a1014
Fix gdb/libpython.py for not ready Unicode strings
_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
14 years ago
Victor Stinner
7931d9a951
Replace PyUnicodeObject type by PyObject
* _PyUnicode_CheckConsistency() now takes a PyObject* instead of void*
* Remove now useless casts to PyObject*
14 years ago
Martin v. Löwis
23e275b3ad
Port UCS1 and charmap codecs to new API.
14 years ago
Nick Coghlan
de31b191e5
Issue 1294232: Fix errors in metaclass calculation affecting some cases of metaclass inheritance. Patch by Daniel Urban.
14 years ago
Martin v. Löwis
0d3072e98d
Drop Py_UCS4_ functions. Closes #13246 .
14 years ago
Victor Stinner
9db1a8b69f
Replace PyUnicodeObject* by PyObject* where it was irrevelant
A Unicode string can now be a PyASCIIObject, PyCompactUnicodeObject or
PyUnicodeObject. Aliasing a PyASCIIObject* or PyCompactUnicodeObject* to
PyUnicodeObject* is wrong
14 years ago
Ezio Melotti
931b8aac80
#12753 : Add support for Unicode name aliases and named sequences.
14 years ago
Victor Stinner
55c7e00fc0
Simplify _PyUnicode_COMPACT_DATA() macro
14 years ago
Victor Stinner
3a50e7056e
Issue #12281 : Rewrite the MBCS codec to handle correctly replace and ignore
error handlers on all Windows versions. The MBCS codec is now supporting all
error handlers, instead of only replace to encode and ignore to decode.
14 years ago
Antoine Pitrou
e60698317d
Fix build under Windows
14 years ago
Martin v. Löwis
bd928fef42
Rename _Py_identifier to _Py_IDENTIFIER.
14 years ago
Victor Stinner
f5cff56a1b
Issue #13088 : Add shared Py_hexdigits constant to format a number into base 16
14 years ago
Victor Stinner
8813104e53
Simplify PyUnicode_MAX_CHAR_VALUE
Use PyUnicode_IS_ASCII instead of PyUnicode_IS_COMPACT_ASCII, so the following
test can be removed:
PyUnicode_DATA(op) == (((PyCompactUnicodeObject *)(op))->utf8)
14 years ago
Antoine Pitrou
6b4883dec0
PEP 3151 / issue #12555 : reworking the OS and IO exception hierarchy.
14 years ago
Victor Stinner
794d567b17
any_find_slice() doesn't use callbacks anymore
* Call directly the right find/rfind method: allow inlining functions
* Remove Py_LOCAL_CALLBACK (added for any_find_slice)
14 years ago
Martin v. Löwis
87da872c69
Drop extra semicolon.
14 years ago
Martin v. Löwis
afe55bba33
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
14 years ago
Martin v. Löwis
c47adb04b3
Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE.
14 years ago
Georg Brandl
db6c7f5c33
Update C API docs for PEP 393.
14 years ago
Antoine Pitrou
eeb7eea1f9
Issue #12911 : Fix memory consumption when calculating the repr() of huge tuples or lists.
This introduces a small private API for this common pattern.
The issue has been discovered thanks to Martin's huge-mem buildbot.
14 years ago
Victor Stinner
b066cc6aba
Fix PyUnicode_CHARACTER_SIZE and PyUnicode_KIND_SIZE
14 years ago
Antoine Pitrou
dbf697ae5c
Fix compilation warnings under 64-bit Windows
14 years ago
Victor Stinner
1d4b35f4e5
rephrase PyUnicode_1BYTE_KIND documentation
14 years ago
Victor Stinner
fb9ea8c57e
Don't check for the maximum character when copying from unicodeobject.c
* Create copy_characters() function which doesn't check for the maximum
character in release mode
* _PyUnicode_CheckConsistency() is no more static to be able to use it
in _PyUnicode_FormatAdvanced() (in formatter_unicode.c)
* _PyUnicode_CheckConsistency() checks the string hash
14 years ago
Éric Araujo
80a348c0a0
Fix typo
14 years ago
Antoine Pitrou
36225c6a99
Try to fix linking failures under Windows
14 years ago
Victor Stinner
30134f53fc
Complete documentation of compact ASCII strings
14 years ago
Victor Stinner
a41463c203
Document utf8_length and wstr_length states
Ensure these states with assertions in _PyUnicode_CheckConsistency().
14 years ago
Victor Stinner
7f11ad4594
Unicode: document when the wstr pointer is shared with data
Add also related assertions to _PyUnicode_CheckConsistency().
14 years ago
Victor Stinner
8cfcbed4e3
Improve string forms and PyUnicode_Resize() documentation
Remove also the FIXME for resize_copy(): as discussed with Martin, copy the
string on resize if the string is not resizable is just fine.
14 years ago
Victor Stinner
c3cec7868b
Add asciilib: similar to ucs1, ucs2 and ucs4 library, but specialized to ASCII
ucs1, ucs2 and ucs4 libraries have to scan created substring to find the
maximum character, whereas it is not need to ASCII strings. Because ASCII
strings are common, it is useful to optimize ASCII.
14 years ago
Victor Stinner
4d0d54bcba
Document requierements of Unicode kinds
14 years ago
Georg Brandl
07de325672
More fixes.
14 years ago
Georg Brandl
c6bc4c6897
Fix a few typos in the unicode header.
14 years ago
Georg Brandl
4975a9b44d
Fix grammar.
14 years ago
Victor Stinner
b9275c104e
Speedup str[a:b] and PyUnicode_FromKindAndData
* str[a:b] doesn't scan the string for the maximum character if the string
is ascii only
* PyUnicode_FromKindAndData() stops if we are sure that we cannot use a
shorter character type. For example, _PyUnicode_FromUCS1() stops if we
have at least one character in range U+0080-U+00FF
14 years ago
Victor Stinner
85041a54bd
_PyUnicode_CheckConsistency() checks utf8 field consistency
14 years ago
Victor Stinner
a3b334da6d
PyUnicode_Ready() now sets ascii=1 if maxchar < 128
ascii=1 is no more reserved to PyASCIIObject. Use
PyUnicode_IS_COMPACT_ASCII(obj) to check if obj is a PyASCIIObject (as before).
14 years ago
Victor Stinner
910337b42e
Add _PyUnicode_CheckConsistency() macro to help debugging
* Document Unicode string states
* Use _PyUnicode_CheckConsistency() to ensure that objects are always
consistent.
14 years ago
Victor Stinner
37943769ef
PyUnicode_READ_CHAR() ensures that the string is ready
14 years ago
Victor Stinner
7a48ff7e06
Use Py_UCS1 instead of unsigned char in unicodeobject.h
14 years ago
Victor Stinner
cd9950fd09
PyUnicode_WriteChar() raises IndexError on invalid index
PyUnicode_WriteChar() raises also a ValueError if the string has more than 1
reference.
14 years ago
Victor Stinner
9f789e7f63
_PyUnicode_AsKind() is *not* part of the stable ABI
14 years ago
Victor Stinner
4584a5ba1a
PyUnicode_CHARACTER_SIZE(): add a reference to PyUnicode_KIND_SIZE()
14 years ago
Victor Stinner
034f6cf10c
Add PyUnicode_Copy() function, include it to the public API
14 years ago