summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Fix in PyList_New(). With GC enabled and when out of memory,Vladimir Marangozov2000-07-151-1/+1
| | | | free() the GC pointer, not the object pointer.
* Added PyObject_AsFileDescriptor, which checks for integer, long integer,Andrew M. Kuchling2000-07-131-0/+58
| | | | or .fileno() method
* Propagate the current exception in get_inprogress_dict() -- it doesn'tVladimir Marangozov2000-07-121-1/+0
| | | | need to be cleared.
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-123-4/+4
|
* change abstract size functions PySequence_Size &c.Jeremy Hylton2000-07-122-9/+9
| | | | add macros for backwards compatibility with C source
* Fix typo in error messageAndrew M. Kuchling2000-07-121-1/+1
|
* Include macglue.h on the macintosh, so function prototypes are in scope.Jack Jansen2000-07-111-0/+4
|
* small updates to string_join:Jeremy Hylton2000-07-111-6/+9
| | | | | | | use PyString_AS_STRING macro on local string object when resizing string, make sure resized string will always be big enough split string containing error message across two lines add test to string_tests that causes resizing
* Jeremy Hylton:Marc-André Lemburg2000-07-111-2/+4
| | | | better error message for unicode coercion failure
* string_join(): Some cleaning up of reference counting. In theBarry Warsaw2000-07-111-7/+10
| | | | | | | | seqlen==1 clause, before returning item, we need to DECREF seq. In the res=PyString... failure clause, we need to goto finally to also decref seq (and the DECREF of res in finally is changed to a XDECREF). Also, we need to DECREF seq just before the PyUnicode_Join() return.
* fix two refcount bugs in new string_join implementation:Jeremy Hylton2000-07-111-6/+2
| | | | | 1. PySequence_Fast_GET_ITEM is a macro and borrows a reference 2. The seq returned from PySequence_Fast must be decref'd
* two changes to string_join:Jeremy Hylton2000-07-101-82/+42
| | | | | | implementation -- use PySequence_Fast interface to iterate over elements interface -- if instance object reports wrong length, ignore it; previous version raised an IndexError if reported length was too high
* - changed hash calculation for unicode strings. the newFredrik Lundh2000-07-101-18/+20
| | | | | | | | | | value is calculated from the character values, in a way that makes sure an 8-bit ASCII string and a unicode string with the same contents get the same hash value. (as a side effect, this also works for ISO Latin 1 strings). for more details, see the python-dev discussion.
* ANSI-fication of the sources.Fred Drake2000-07-091-105/+46
|
* ANSI-fication of the sources.Fred Drake2000-07-092-214/+83
|
* Somebody started playing with const, so of course the outcomeTim Peters2000-07-091-8/+8
| | | | | | | | | | | | | was cascades of warnings about mismatching const decls. Overall, I think const creates lots of headaches and solves almost nothing. Added enough consts to shut up the warnings, but this did require casting away const in one spot too (another usual outcome of starting down this path): the function mymemreplace can't return const char*, but sometimes wants to return its first argument as-is, which latter must be declared const char* in order to avoid const warnings at mymemreplace's call sites. So, in the case the function wants to return the first arg, that arg's declared constness must be subverted.
* ANSI-fication of the sources.Fred Drake2000-07-093-252/+102
|
* ANSI-fication of the sources.Fred Drake2000-07-093-60/+22
|
* ANSI-fication of the sources.Fred Drake2000-07-093-79/+33
|
* ANSI-fication of the sources.Fred Drake2000-07-091-27/+10
|
* Remove legacy use of __SC__; no longer needed now that ANSI source isFred Drake2000-07-091-5/+0
| | | | the standard for Python implementation.
* ANSI-fication of the sources.Fred Drake2000-07-092-155/+59
|
* ANSI-fication of the sources.Fred Drake2000-07-091-98/+48
|
* type_error(): Added "const" to signature to eliminate warning with -Wall.Fred Drake2000-07-091-1/+1
|
* ANSI-fication of the source.Fred Drake2000-07-091-109/+95
| | | | Make the indentation and brace placement internally consistent.
* ANSI-fication of the sources.Fred Drake2000-07-093-360/+135
|
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-096-33/+33
|
* - changed __repr__ to use "unicode escape" encoding for unicodeFredrik Lundh2000-07-081-1/+1
| | | | | strings, instead of the default encoding. (see "minidom" thread for discussion, and also patch #100706)
* delete unused local variable from _PyTrash_deposit_objectSkip Montanaro2000-07-081-1/+0
|
* _Py_RefTotal should only be declared here when Py_TRACE_REFS are #define'dSkip Montanaro2000-07-081-0/+2
|
* Cray J90 fixes for long ints.Tim Peters2000-07-082-9/+9
| | | | | | | | | | | | | | | | This was a convenient excuse to create the pyport.h file recently discussed! Please use new Py_ARITHMETIC_RIGHT_SHIFT when right-shifting a signed int and you *need* sign-extension. This is #define'd in pyport.h, keying off new config symbol SIGNED_RIGHT_SHIFT_ZERO_FILLS. If you're running on a platform that needs that symbol #define'd, the std tests never would have worked for you (in particular, at least test_long would have failed). The autoconfig stuff got added to Python after my Unix days, so I don't know how that works. Would someone please look into doing & testing an auto-config of the SIGNED_RIGHT_SHIFT_ZERO_FILLS symbol? It needs to be defined if & only if, e.g., (-1) >> 3 is not -1.
* The tail end of x_sub implicitly assumed that an unsigned shortTim Peters2000-07-081-0/+1
| | | | contains 16 bits. Not true on Cray J90.
* Got RID of redundant coercions in longobject.c (as spotted by GregTim Peters2000-07-081-6/+3
| | | | | | | Stein -- thanks!). Incidentally removed all the Py_PROTO macros from object.h, as they prevented my editor from magically finding the definitions of the "coercion", "cmpfunc" and "reprfunc" typedefs that were being redundantly applied in longobject.c.
* New surrogate support in the UTF-8 codec. By Bill Tutt.Marc-André Lemburg2000-07-071-29/+80
|
* Some cleanup of longs in prepartion for Cray J90 fixes: gotTim Peters2000-07-071-241/+105
| | | | | rid of Py_PROTO, switched to ANSI function decls, and did some minor fiddling.
* Added new API PyUnicode_FromEncodedObject() which supports decodingMarc-André Lemburg2000-07-071-6/+49
| | | | | | objects including instance objects. The old API PyUnicode_FromObject() is still available as shortcut.
* Fix to bug #393 (UTF16 codec didn't like empty strings) andMarc-André Lemburg2000-07-071-7/+6
| | | | | corrected some usage of 'unsigned long' where Py_UNICODE should have been used.
* Two more places where long should be used instead of int. EspeciallySjoerd Mullender2000-07-071-2/+2
| | | | true after revision 2.36 was checked in...
* Fixed some code that used 'short' to use 'long' instead.Marc-André Lemburg2000-07-061-3/+3
|
* Fixed a couple of places where 'int' was used where 'long'Marc-André Lemburg2000-07-061-7/+7
| | | | should have been used.
* Conditionally (currently on ifdef macintosh) break the large switch upJack Jansen2000-07-061-0/+15
| | | | into 1000-case smaller ones.
* Added new codec APIs and a new interface method .encode() whichMarc-André Lemburg2000-07-061-0/+114
| | | | | | | | | works just like the Unicode one. The C APIs match the ones in the Unicode implementation, but were extended to be able to reuse the existing Unicode codecs for string purposes too. Conversions from string to Unicode and back are done using the default encoding.
* Fix to bug #389:Marc-André Lemburg2000-07-051-4/+4
| | | | | | | Full_Name: Bastian Kleineidam Version: 2.0b1 CVS 5.7.2000 OS: Debian Linux 2.2 Submission from: earth.cs.uni-sb.de (134.96.252.92)
* Added new .isalpha() and .isalnum() methods which provide interfacesMarc-André Lemburg2000-07-051-0/+66
| | | | to the new alphabetic lookup APIs in unicodectype.c.
* Added new lookup API which matches all alphabetic Unicode characters,Marc-André Lemburg2000-07-051-0/+5295
| | | | i.e the ones with category 'Ll','Lu','Lt','Lo','Lm'.
* Added new .isalpha() and .isalnum() methods to match the sameMarc-André Lemburg2000-07-051-0/+68
| | | | | ones on the Unicode objects. Note that the string versions use the (locale aware) C lib APIs isalpha() and isalnum().
* Removed Py_PROTO and switched to ANSI C declarations in the dictTim Peters2000-07-041-104/+34
| | | | | | | implementation. This was really to test whether my new CVS+SSH setup is more usable than the old one -- and turns out it is (for whatever reason, it was impossible to do a commit before that involved more than one directory).
* Bill Tutt:Marc-André Lemburg2000-07-041-6/+29
| | | | | Make unicode_compare a true UTF-16 compare function (includes support for surrogates).
* If auto-conversion fails, the Unicode codecs will return NULL.Marc-André Lemburg2000-07-031-11/+13
| | | | This is now checked and the error passed on to the caller.
* changed repr and str to always convert unicode stringsFredrik Lundh2000-07-011-0/+16
| | | | to 8-bit strings, using the default encoding.