summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* SF bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complainWalter Dörwald2005-08-301-0/+10
| | | | | about illegal code points. The codec now supports PEP 293 style error handlers. (This is a variant of the Nik Haldimann's patch that detects truncated data)
* Disallow keyword arguments for type constructors that don't use them.Georg Brandl2005-08-261-0/+1
| | | | (fixes bug #1119418)
* Numerous fix-ups to C API and docs. Added tests for C API.Raymond Hettinger2005-08-161-1/+1
|
* Add a C API for sets and frozensets.Raymond Hettinger2005-08-161-0/+9
|
* Change the %s format specifier for str objects so that it returns aNeil Schemenauer2005-08-121-0/+1
| | | | | unicode instance if the argument is not an instance of basestring and calling __str__ on the argument returns a unicode instance.
* * Bring in INIT_NONZERO_SET_SLOTS macro from dictionary code.Raymond Hettinger2005-08-071-1/+5
| | | | | | | | * Bring in free list from dictionary code. * Improve several comments. * Differencing can leave many dummy entries. If more than 1/6 are dummies, then resize them away. * Factor-out common code with new macro, PyAnySet_CheckExact.
* * set_new() doesn't need to zero the structure a second time after tp_allocRaymond Hettinger2005-08-061-0/+6
| | | | | has already done the job. * Use a macro form of PyErr_Occurred() inside the set_lookkey() function.
* Model set.pop() after dict.popitem().Raymond Hettinger2005-08-021-0/+4
|
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-023-0/+3
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* * Improve code for the empty frozenset singleton:Raymond Hettinger2005-08-012-2/+2
| | | | | | | | | | | - Handle both frozenset() and frozenset([]). - Do not use singleton for frozenset subclasses. - Finalize the singleton. - Add test cases. * Factor-out set_update_internal() from set_update(). Simplifies the code for several internal callers. * Factor constant expressions out of loop in set_merge_internal(). * Minor comment touch-ups.
* Revised the set() and frozenset() implementaion to use its own internalRaymond Hettinger2005-07-311-13/+45
| | | | | data structure instead of using dictionaries. Reduces memory consumption by 1/3 and provides modest speed-ups for most set operations.
* [ 1243081 ] repair typosGeorg Brandl2005-07-221-1/+1
|
* Add comments about PyThreadState and the usage of its fields.Brett Cannon2005-06-251-1/+5
|
* This is my patch:Michael W. Hudson2005-06-031-1/+1
| | | | | | | | | [ 1180995 ] binary formats for marshalling floats Adds 2 new type codes for marshal (binary floats and binary complexes), a new marshal version (2), updates MAGIC and fiddles the de-serializing of code objects to be less likely to clobber the real reason for failing if it fails.
* This is my patch:Michael W. Hudson2005-05-272-12/+18
| | | | | | | | | | | | | | [ 1181301 ] make float packing copy bytes when they can which hasn't been reviewed, despite numerous threats to check it in anyway if noone reviews it. Please read the diff on the checkin list, at least! The basic idea is to examine the bytes of some 'probe values' to see if the current platform is a IEEE 754-ish platform, and if so _PyFloat_{Pack,Unpack}{4,8} just copy bytes around. The rest is hair for testing, and tests.
* Patch #1115086: support PY_LONGLONG in structmember.Martin v. Löwis2005-03-031-0/+4
|
* Patch #802188: better parser error message for non-EOL following line cont.Martin v. Löwis2005-03-031-0/+1
|
* Remove PyRange_New().Raymond Hettinger2004-12-031-2/+0
|
* post 2.4 release machinationsAnthony Baxter2004-11-301-3/+3
|
* preparing for 2.4 final (wooooooo!)Anthony Baxter2004-11-291-3/+3
|
* Correct the handling of 0-termination of PyUnicode_AsWideChar()Marc-André Lemburg2004-11-221-2/+8
| | | | | | | | and its usage in PyLocale_strcoll(). Clarify the documentation on this. Thanks to Andreas Degert for pointing this out.
* preparing for rc1Anthony Baxter2004-11-151-4/+4
|
* SF patch #1035255: Remove CoreServices / CoreFoundation dependencies in coreRaymond Hettinger2004-11-051-13/+14
| | | | | | | | | | | | | (Contributed by Bob Ippolito.) This patch trims down the Python core on Darwin by making it independent of CoreFoundation and CoreServices. It does this by: Changed linker flags in configure/configure.in Removed the unused PyMac_GetAppletScriptFile Moved the implementation of PyMac_StrError to the MacOS module Moved the implementation of PyMac_GetFullPathname to the Carbon.File module
* release bitAnthony Baxter2004-11-021-2/+2
|
* SF patch #1056231: typo in comment (unicodeobject.h)Raymond Hettinger2004-10-311-1/+1
|
* SF 1055820: weakref callback vs gc vs threadsTim Peters2004-10-301-0/+20
| | | | | | | | In cyclic gc, clear weakrefs to unreachable objects before allowing any Python code (weakref callbacks or __del__ methods) to run. This is a critical bugfix, affecting all versions of Python since weakrefs were introduced. I'll backport to 2.3.
* Wrote down the invariants of some common objects whose structure isArmin Rigo2004-10-2810-23/+75
| | | | | | | | | | exposed in header files. Fixed a few comments in these headers. As we might have expected, writing down invariants systematically exposed a (minor) bug. In this case, function objects have a writeable func_code attribute, which could be set to code objects with the wrong number of free variables. Calling the resulting function segfaulted the interpreter. Added a corresponding test.
* bump the version number prior to releaseFred Drake2004-10-141-3/+3
|
* SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by NickTim Peters2004-10-111-0/+1
| | | | | Coghlan, for determining whether PyEval_InitThreads() has been called. Also purged the undocumented+unused _PyThread_Started int.
* SF patch #1035498: -m option to run a module as a scriptRaymond Hettinger2004-10-071-0/+4
| | | | (Contributed by Nick Coghlan.)
* Finalize the freelist of list objects.Raymond Hettinger2004-10-071-0/+1
|
* Introduced a Py_IS_NAN macro, which probably works on the major platformsTim Peters2004-09-231-2/+17
| | | | | | today. pyconfig.h can override it if not, and can also override Py_IS_INFINITY now. Py_IS_NAN and Py_IS_INFINITY are overridden now for Microsoft compilers, using efficient MS-specific spellings.
* A static swapped_op[] array was defined in 3 different C files, & I thinkTim Peters2004-09-231-0/+5
| | | | | I need to define it again. Bite the bullet and define it once as an extern, _Py_SwappedOp[].
* Removed redundant declaration of _PyLong_NumBits().Tim Peters2004-09-231-1/+0
|
* SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now supportWalter Dörwald2004-09-071-0/+21
| | | | | | | | | | | decoding incomplete input (when the input stream is temporarily exhausted). codecs.StreamReader now implements buffering, which enables proper readline support for the UTF-16 decoders. codecs.StreamReader.read() has a new argument chars which specifies the number of characters to return. codecs.StreamReader.readline() and codecs.StreamReader.readlines() have a new argument keepends. Trailing "\n"s will be stripped from the lines if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and PyUnicode_DecodeUTF16Stateful.
* SF patch #1020188: Use Py_CLEAR where necessary to avoid crashesRaymond Hettinger2004-09-011-1/+1
| | | | (Contributed by Dima Dorfman)
* SF patch #1007189, multi-line imports, for instance:Anthony Baxter2004-08-311-49/+53
| | | | | "from blah import (foo, bar baz, bongo)"
* onward and upwardAnthony Baxter2004-08-311-2/+2
|
* SF patch 936813: fast modular exponentiationTim Peters2004-08-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | This checkin is adapted from part 2 (of 3) of Trevor Perrin's patch set. BACKWARD INCOMPATIBILITY: SHIFT must now be divisible by 5. AFAIK, nobody will care. long_pow() could be complicated to worm around that, if necessary. long_pow(): - BUGFIX: This leaked the base and power when the power was negative (and so the computation delegated to float pow). - Instead of doing right-to-left exponentiation, do left-to-right. This is more efficient for small bases, which is the common case. - In addition, if the exponent is large (more than FIVEARY_CUTOFF digits), precompute [a**i % c for i in range(32)], and go left to right 5 bits at a time. l_divmod(): - The signature changed so that callers who don't want the quotient, or don't want the remainder, can pass NULL in the slot they don't want. This saves them from having to declare a vrbl for unwanted stuff, and remembering to decref it. long_mod(), long_div(), long_classic_div(): - Adjust to new l_divmod() signature, and simplified as a result.
* SF patch 936813: fast modular exponentiationTim Peters2004-08-291-1/+1
| | | | | | | | | | | | | | | | | | This checkin is adapted from part 1 (of 3) of Trevor Perrin's patch set. x_mul() - sped a little by optimizing the C - sped a lot (~2X) if it's doing a square; note that long_pow() squares often k_mul() - more cache-friendly now if it's doing a square KARATSUBA_CUTOFF - boosted; gradeschool mult is quicker now, and it may have been too low for many platforms anyway KARATSUBA_SQUARE_CUTOFF - new - since x_mul is a lot faster at squaring now, the point at which Karatsuba pays for squaring is much higher than for general mult
* Stop producing or using OverflowWarning. PEP 237 thought this wouldTim Peters2004-08-251-0/+1
| | | | | | | happen in 2.3, but nobody noticed it still was getting generated (the warning was disabled by default). OverflowWarning and PyExc_OverflowWarning should be removed for 2.5, and left notes all over saying so.
* Patch #900727: Add Py_InitializeEx to allow embedding without signals.Martin v. Löwis2004-08-191-0/+1
|
* Patch #1006003: Cygwin standard module build problemsJason Tishler2004-08-092-3/+4
| | | | Add missing PyAPI_FUNC/PyAPI_DATA macros.
* SF #989185: Drop unicode.iswide() and unicode.width() and addHye-Shik Chang2004-08-041-18/+0
| | | | | | | | | | | | unicodedata.east_asian_width(). You can still implement your own simple width() function using it like this: def width(u): w = 0 for c in unicodedata.normalize('NFC', u): cwidth = unicodedata.east_asian_width(c) if cwidth in ('W', 'F'): w += 2 else: w += 1 return w
* Add a workaround for a problem that UTF-8 strings can be corruptedHye-Shik Chang2004-08-041-0/+33
| | | | | | | or broken by basic ctype functions in 4.4BSD descendants. This will be fixed in their future development branches but they'll keep the POSIX-incompatibility for their backward-compatiblities in near future.
* on to a2!Anthony Baxter2004-08-031-2/+2
|
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-023-72/+77
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Fix typo in commentNeal Norwitz2004-08-011-1/+1
|
* * drop the unreasonable list invariant that ob_item should never come backArmin Rigo2004-07-291-3/+1
| | | | | | | | | | | | | | | | | | | | | to NULL during the lifetime of the object. * listobject.c nevertheless did not conform to the other invariants, either; fixed. * listobject.c now uses list_clear() as the obvious internal way to clear a list, instead of abusing list_ass_slice() for that. It makes it easier to enforce the invariant about ob_item == NULL. * listsort() sets allocated to -1 during sort; any mutation will set it to a value >= 0, so it is a safe way to detect mutation. A negative value for allocated does not cause a problem elsewhere currently. test_sort.py has a new test for this fix. * listsort() leak: if items were added to the list during the sort, AND if these items had a __del__ that puts still more stuff into the list, then this more stuff (and the PyObject** array to hold them) were overridden at the end of listsort() and never released.
* Fix obscure breakage (relative to 2.3) in listsort: the test for listTim Peters2004-07-291-0/+3
| | | | | | | | | | | | mutation during list.sort() used to rely on that listobject.c always NULL'ed ob_item when ob_size fell to 0. That's no longer true, so the test for list mutation during a sort is no longer reliable. Changed the test to rely instead on that listobject.c now never NULLs-out ob_item after (if ever) ob_item gets a non-NULL value. This new assumption is also documented now, as a required invariant in listobject.h. The new assumption allowed some real simplification to some of the hairier code in listsort(), so is a Good Thing on that count.