summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Validate that __length_hint__ returns a usable result.Raymond Hettinger2009-02-031-1/+1
|
* Issue 1242657: list(obj) can swallow KeyboardInterrupt.Raymond Hettinger2009-02-023-14/+27
|
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-0233-72/+72
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Remove exception for non-NULL tp_compare that was introduced in r69188.Mark Dickinson2009-02-011-7/+0
|
* Issue #1717, continued: remove PyObject_Compare and Py_CmpToRich declarationsMark Dickinson2009-02-012-32/+18
| | | | | | from object.h; don't inherit tp_compare slot on subclasses; and raise TypeError when initializing a type that has a nonzero tp_compare slot. Fix up comparison-related comments in object.c and code.h.
* Issue #1717: remove the cmp builtin function, the C-API functionsMark Dickinson2009-02-013-117/+1
| | | | PyObject_Cmp, PyObject_Compare, and various support functions.
* Issue #1717, stage 2: remove uses of tp_compare in Modules and mostMark Dickinson2009-02-014-41/+119
| | | | Objects.
* fix indentation againBenjamin Peterson2009-01-311-2497/+2497
|
* detabify Objects/unicodeobject.cBenjamin Peterson2009-01-311-3092/+3092
|
* Issue #4707: round(x, n) now returns an integer when x is an integer.Mark Dickinson2009-01-281-20/+128
| | | | Previously it returned a float.
* Merged revisions 68974-68975 via svnmerge fromMark Dickinson2009-01-261-8/+9
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68974 | mark.dickinson | 2009-01-26 21:36:30 +0000 (Mon, 26 Jan 2009) | 4 lines Fix undefined behaviour (left shift of negative value) in long_hash. Also, rewrap a line of length > 79, and update comments. ........ r68975 | mark.dickinson | 2009-01-26 21:40:08 +0000 (Mon, 26 Jan 2009) | 2 lines Fix comment. ........
* Merged revisions 68947 via svnmerge fromMark Dickinson2009-01-251-1/+1
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68947 | mark.dickinson | 2009-01-25 22:12:31 +0000 (Sun, 25 Jan 2009) | 3 lines No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough. This change should silence a compiler warning on Windows. ........
* Merged revisions 68890 via svnmerge fromMark Dickinson2009-01-241-23/+20
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines Issue #4393: fix 3 classes of potential portability problems in longobject.c: - fix some places where counters into ob_digit were declared as int instead of Py_ssize_t - add (twodigit) casts where necessary - fix code in _PyLong_AsByteArray that uses << on negative values ........
* Some minor cleanups in PyLong_FromLong:Mark Dickinson2009-01-241-12/+15
| | | | | | | | | - fast path wasn't being properly taken for negative ints; thanks Victor Stinner for pointing this out. - use Py_SAFE_DOWNCAST instead of direct casting to digit (it's safer, especially if we ever consider moving to 30-bit digits) - cleaner way to write negation
* Merged revisions 68750,68776-68777,68811,68842,68859 via svnmerge fromBenjamin Peterson2009-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68750 | benjamin.peterson | 2009-01-18 16:47:04 -0600 (Sun, 18 Jan 2009) | 1 line fix encoding cookie case ........ r68776 | benjamin.peterson | 2009-01-19 10:17:54 -0600 (Mon, 19 Jan 2009) | 1 line move BufferedIOBase into the base class section ........ r68777 | benjamin.peterson | 2009-01-19 10:18:27 -0600 (Mon, 19 Jan 2009) | 1 line add email address ........ r68811 | benjamin.peterson | 2009-01-20 12:58:27 -0600 (Tue, 20 Jan 2009) | 1 line fix url ........ r68842 | andrew.kuchling | 2009-01-20 20:16:26 -0600 (Tue, 20 Jan 2009) | 1 line Markup fixes ........ r68859 | georg.brandl | 2009-01-22 12:29:28 -0600 (Thu, 22 Jan 2009) | 2 lines Clarify wording. ........
* Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x.Mark Dickinson2009-01-201-2/+0
|
* Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 ↵Benjamin Peterson2009-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines Change an example in the docs to avoid a mistake when the code is copy pasted and changed afterwards. ........ r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line use enumerate ........ r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h ........ r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line fix grammar ........ r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line #4976: union() and intersection() take multiple args, but talk about "the other". ........ r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line #4974: fix redundant mention of lists and tuples. ........ r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line #4914: trunc is in math. ........ r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line #4979: correct result range for some random functions. ........ r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line #4857: fix augmented assignment target spec. ........ r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line #4923: clarify what was added. ........ r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line #4986: augassigns are not expressions. ........ r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line fix test that wasn't working as expected #4990 ........
* Merged revisions 68568,68665 via svnmerge fromBenjamin Peterson2009-01-181-2/+2
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68568 | georg.brandl | 2009-01-13 02:11:07 -0600 (Tue, 13 Jan 2009) | 2 lines Fix call signature and markup. ........ r68665 | amaury.forgeotdarc | 2009-01-17 11:11:50 -0600 (Sat, 17 Jan 2009) | 3 lines #4930: Slightly cleaner (and faster) code in type creation: compare slots by address, not by name. ........
* Replace PyNumber_Int with PyNumber_Long.Mark Dickinson2009-01-171-1/+1
|
* Issue #4838: When a module is deallocated, free the memory backing the ↵Antoine Pitrou2009-01-171-0/+2
| | | | optional module state data.
* Remove attempted long->int conversions in py3k version of ↵Mark Dickinson2009-01-171-6/+0
| | | | float.as_integer_ratio.
* Issue #4910, patch 3/3: rename nb_long to nb_reservedMark Dickinson2009-01-177-10/+6
|
* Issue 4910, patch 2 of (probably) 3: pave the way for renaming ofMark Dickinson2009-01-154-13/+4
| | | | | | | | | nb_long: remove last remaining use of nb_long (in the struct module) from the core, set nb_long slots on all builtin and extension types to 0, and remove uses of __long__ in test_complex and test_binop. Reviewed by Benjamin Peterson.
* Issue #4935: The overflow checking code in the expandtabs() method commonAntoine Pitrou2009-01-131-37/+30
| | | | | | | to str, bytes and bytearray could be optimized away by the compiler (*), letting the interpreter segfault instead of raising an error. (*) or at least it is our interpretation
* Merged revisions 68560 via svnmerge fromAmaury Forgeot d'Arc2009-01-123-2/+19
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (mar., 13 janv. 2009) | 6 lines #3720: Interpreter crashes when an evil iterator removes its own next function. Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0. ........
* Issue #4910 (1st patch of a series): fix int() and the correspondingMark Dickinson2009-01-121-13/+1
| | | | | | | | | PyNumber_Int/PyNumber_Long API function so that it no longer attempts to call the __long__ method for conversion. Only the __int__ and __trunc__ methods are used. (This removes a major remaining use of the nb_long slot from the Python 3.x core.) Thanks Benjamin for review.
* Issue #4916: fix little-endian UTF-16 decoding bug on big-endian UCS-4 ↵Antoine Pitrou2009-01-111-8/+16
| | | | builds, introduced by r68483.
* Merged revisions 68381 via svnmerge fromBenjamin Peterson2009-01-113-11/+16
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68381 | martin.v.loewis | 2009-01-07 12:40:40 -0600 (Wed, 07 Jan 2009) | 2 lines Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. ........
* Issue #4910: replace "long" with "int" in docstring for __long__ slot andMark Dickinson2009-01-101-1/+1
| | | | in documentation for PyNumber_Long.
* Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. TheAntoine Pitrou2009-01-101-24/+207
| | | | | | | | common cases are optimized thanks to a dedicated fast path and a moderate amount of loop unrolling. This will especially help text I/O (we already register a 30% speedup on large reads on the io-c branch).
* Reduce the size of the _PyLong_DigitValue table.Raymond Hettinger2009-01-091-3/+3
|
* Issue #4822: fix messy indentation in memoryobject.c/.h, before we may ↵Antoine Pitrou2009-01-031-432/+431
| | | | | | backport it to trunk. Reviewed on IRC by Georg Brandl, with assistance by Benjamin Peterson.
* Issue #4580: slicing of memoryviews when itemsize != 1 is wrong.Antoine Pitrou2009-01-032-69/+64
| | | | | | | | Also fix len() to return number of items rather than length in bytes. I'm sorry it was not possible for me to work on this without reindenting a bit some stuff around. The indentation in memoryobject.c is a mess, I'll open a separate bug for it.
* Remove traces of Py_InitModule*.Georg Brandl2009-01-021-2/+2
|
* Merged revisions 68128 via svnmerge fromAntoine Pitrou2009-01-012-20/+45
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (jeu., 01 janv. 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ........
* Recorded merge of revisions 68051 via svnmerge fromNick Coghlan2008-12-301-0/+11
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68051 | nick.coghlan | 2008-12-30 11:18:48 +1000 (Tue, 30 Dec 2008) | 1 line Issue #4701: implicitly call PyType_Ready from PyObject_Hash ........
* #4759: allow None as first argument of bytearray.translate(), for ↵Georg Brandl2008-12-281-16/+25
| | | | | | consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6.
* Remove confusing error message in bytes.translate.Georg Brandl2008-12-271-5/+0
|
* Revert unwanted function name change introduced by r67939.Alexandre Vassalotti2008-12-271-1/+1
|
* Fixed incompatible pointer warning.Hirokazu Yamamoto2008-12-271-1/+1
|
* Fix bogus assertion.Alexandre Vassalotti2008-12-271-1/+1
|
* Optimize built-in unicode codecs by avoiding unnecessary copying.Alexandre Vassalotti2008-12-271-50/+58
| | | | | | The approach used is similiar to what is currently used in the version of unicodeobject.c in Python 2.x. The only difference is we use _PyBytes_Resize instead of _PyString_Resize.
* Fix wrong bytes type conversion in PyUnicode_AsUnicodeEscapeString.Alexandre Vassalotti2008-12-271-15/+4
| | | | Fix wrong bytes type conversion in PyUnicode_AsUnicodeDecodeString.
* Merged revisions 67932 via svnmerge fromAlexandre Vassalotti2008-12-271-28/+30
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r67932 | alexandre.vassalotti | 2008-12-27 01:36:10 -0500 (Sat, 27 Dec 2008) | 5 lines Remove unnecessary casts related to unicode_decode_call_errorhandler. Make the _PyUnicode_Resize macro a static function. These changes are needed to avoid breaking strict aliasing rules. ........
* Merged revisions ↵Benjamin Peterson2008-12-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 67654,67676-67677,67681,67692,67725,67761,67784-67785,67787-67788,67802,67848-67850,67862-67864,67880,67882 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r67654 | georg.brandl | 2008-12-07 16:42:09 -0600 (Sun, 07 Dec 2008) | 2 lines #4457: rewrite __import__() documentation. ........ r67676 | benjamin.peterson | 2008-12-08 20:03:03 -0600 (Mon, 08 Dec 2008) | 1 line specify how things are copied ........ r67677 | benjamin.peterson | 2008-12-08 20:05:11 -0600 (Mon, 08 Dec 2008) | 1 line revert unrelated change to installer script ........ r67681 | jeremy.hylton | 2008-12-09 15:03:10 -0600 (Tue, 09 Dec 2008) | 2 lines Add simple unittests for Request ........ r67692 | amaury.forgeotdarc | 2008-12-10 18:03:42 -0600 (Wed, 10 Dec 2008) | 2 lines #1030250: correctly pass the dry_run option to the mkpath() function. ........ r67725 | benjamin.peterson | 2008-12-12 22:02:20 -0600 (Fri, 12 Dec 2008) | 1 line fix incorrect example ........ r67761 | benjamin.peterson | 2008-12-14 11:26:04 -0600 (Sun, 14 Dec 2008) | 1 line fix missing bracket ........ r67784 | georg.brandl | 2008-12-15 02:33:58 -0600 (Mon, 15 Dec 2008) | 2 lines #4446: document "platforms" argument for setup(). ........ r67785 | georg.brandl | 2008-12-15 02:36:11 -0600 (Mon, 15 Dec 2008) | 2 lines #4611: fix typo. ........ r67787 | georg.brandl | 2008-12-15 02:58:59 -0600 (Mon, 15 Dec 2008) | 2 lines #4578: fix has_key() usage in compiler package. ........ r67788 | georg.brandl | 2008-12-15 03:07:39 -0600 (Mon, 15 Dec 2008) | 2 lines #4568: remove limitation in varargs callback example. ........ r67802 | amaury.forgeotdarc | 2008-12-15 16:29:14 -0600 (Mon, 15 Dec 2008) | 4 lines #3632: the "pyo" macro from gdbinit can now run when the GIL is released. Patch by haypo. ........ r67848 | benjamin.peterson | 2008-12-18 20:28:56 -0600 (Thu, 18 Dec 2008) | 1 line fix typo ........ r67849 | benjamin.peterson | 2008-12-18 20:31:35 -0600 (Thu, 18 Dec 2008) | 1 line _call_method -> _callmethod and _get_value to _getvalue ........ r67850 | raymond.hettinger | 2008-12-19 03:06:07 -0600 (Fri, 19 Dec 2008) | 9 lines Fix-up and clean-up docs for int.bit_length(). * Replace dramatic footnote with in-line comment about possible round-off errors in logarithms of large numbers. * Add comments to the pure python code equivalent. * replace floor() with int() in the mathematical equivalent so the type is correct (should be an int, not a float). * add abs() to the mathematical equivalent so that it matches the previous line that it is supposed to be equivalent to. * make one combined example with a negative input. ........ r67862 | benjamin.peterson | 2008-12-19 20:48:02 -0600 (Fri, 19 Dec 2008) | 1 line copy sentence from docstring ........ r67863 | benjamin.peterson | 2008-12-19 20:51:26 -0600 (Fri, 19 Dec 2008) | 1 line add headings ........ r67864 | benjamin.peterson | 2008-12-19 20:57:19 -0600 (Fri, 19 Dec 2008) | 1 line beef up docstring ........ r67880 | benjamin.peterson | 2008-12-20 16:49:24 -0600 (Sat, 20 Dec 2008) | 1 line remove redundant sentence ........ r67882 | benjamin.peterson | 2008-12-20 16:59:49 -0600 (Sat, 20 Dec 2008) | 1 line add some recent releases to the list ........
* Issue #3106: Speedup some comparisons. This also removes the last callAntoine Pitrou2008-12-202-73/+88
| | | | to Py_CmpToRich from the codebase (in longobject.c).
* Add missing Py_CHARMASK when calling isspace().Kristján Valur Jónsson2008-12-181-2/+2
| | | | Found by enabling runtime tests on windows, by disabling the _set_invalid_parameter_handler() fiddling.
* Forward merge of r67822 to py3k: add bit_length method to int.Mark Dickinson2008-12-171-0/+71
|
* Issue #4569: Interpreter crash when mutating a memoryview with an item size ↵Antoine Pitrou2008-12-071-93/+105
| | | | | | larger than 1. (together with a bit of reindenting)
* Issue #4509: bugs in bytearray with exports (buffer protocol)Antoine Pitrou2008-12-061-11/+31
|