summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
AgeCommit message (Collapse)AuthorLines
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-1992/+1992
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2010-05-07Merged revisions 80758 via svnmerge fromMark Dickinson-45/+72
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80758 | mark.dickinson | 2010-05-04 17:18:25 +0100 (Tue, 04 May 2010) | 9 lines Issue #1533: fix inconsistency in range function argument processing: any non-float non-integer argument is now converted to an integer (if possible) using its __int__ method. Previously, only small arguments were treated this way; larger arguments (those whose __int__ was outside the range of a C long) would produce a TypeError. Patch by Alexander Belopolsky (with minor modifications). ........
2009-12-13Merged revisions 76774 via svnmerge fromBenjamin Peterson-1/+5
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76774 | benjamin.peterson | 2009-12-12 18:54:15 -0600 (Sat, 12 Dec 2009) | 1 line account for PyObject_IsInstance's new ability to fail ........
2009-11-17Merged revisions 76350 via svnmerge fromBenjamin Peterson-1/+1
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76350 | benjamin.peterson | 2009-11-17 15:24:54 -0600 (Tue, 17 Nov 2009) | 1 line a better callable replacement ........
2009-11-09Issue #7070: Fix problem with builtin round function for large oddMark Dickinson-5/+9
integer arguments. Also fixes the sign of round(-0.0).
2009-07-02Merged revisions 73776 via svnmerge fromBenjamin Peterson-18/+74
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73776 | benjamin.peterson | 2009-07-02 13:16:45 -0500 (Thu, 02 Jul 2009) | 1 line when print() gets unicode arguments, sep and end should be unicode by default #4618 ........
2009-02-02Issue 1242657: list(obj) can swallow KeyboardInterruptRaymond Hettinger-0/+2
2008-08-18follup to #3473: don't duplicate the reduce codeBenjamin Peterson-56/+10
2008-07-31#3479: unichr(2**32) used to return u'\x00'.Amaury Forgeot d'Arc-2/+2
The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. (why doesn't gcc issue a truncation warning in this case?)
2008-06-24Revert 64424, 64438, and 64439.Raymond Hettinger-18/+1
2008-06-20Make bin() implementation parallel oct() and hex() so that int/long ↵Raymond Hettinger-1/+18
subclasses can override or so that other classes can support.
2008-06-11Merge in release25-maint r60793:Gregory P. Smith-4/+56
Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-30/+30
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
2008-05-30Issue 2784: fix leaks in exception exit.Raymond Hettinger-2/+2
2008-05-26Renamed PyString to PyBytesChristian Heimes-30/+30
2008-05-26First step of the C API rename:Christian Heimes-4/+4
renamed Include/bytesobject.h to Include/bytearrayobject.h renamed Include/stringobject.h to Include/bytesobject.h added Include/stringobject.h with aliases
2008-05-17revert 63425 over Guido's Febuary message about this, that I missedBenjamin Peterson-27/+15
2008-05-17fix spellingBenjamin Peterson-1/+1
2008-05-17add Py3k warnings to oct and hex. backport hex behavior (because it's not ↵Benjamin Peterson-15/+27
different)
2008-05-12#2196 hasattr now allows SystemExit and KeyboardInterrupt to propagateBenjamin Peterson-3/+7
2008-04-30#2719: backport next() from 3k.Georg Brandl-0/+42
2008-04-27A little reformating of Py3k warningsBenjamin Peterson-6/+6
2008-04-27Use PyErr_WarnPy3k throughoutBenjamin Peterson-25/+13
2008-03-29Properly check for consistency with the third argument ofGeorg Brandl-16/+16
compile() when compiling an AST node.
2008-03-28Patch #1810 by Thomas Lee, reviewed by myself:Georg Brandl-19/+44
allow compiling Python AST objects into code objects in compile().
2008-03-26Merged revisions ↵Christian Heimes-0/+8
61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray ........ r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line Copied files from py3k w/o modifications ........ r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines Take One * Added initialization code, warnings, flags etc. to the appropriate places * Added new buffer interface to string type * Modified tests * Modified Makefile.pre.in to compile the new files * Added bytesobject.c to Python.h ........ r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines Disabled bytearray.extend for now since it causes an infinite recursion Fixed serveral unit tests ........ r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines Added PyBytes support to several places: str + bytearray ord(bytearray) bytearray(str, encoding) ........ r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line Fixed more unit tests related to type('') is not unicode ........ r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines Fixed more unit tests Fixed bytearray.extend ........ r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line Implemented old buffer interface for bytearray ........ r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line Added backport of the io module ........ r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte ........ r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines Fixed more tests Fixed bytearray() comparsion with unicode() Fixed iterator assignment of bytearray ........ r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines str(bytesarray()) now returns the bytes and not the representation of the bytearray object Enabled and fixed more unit tests ........ r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines Clear error PyNumber_AsSsize_t() fails Use CHARMASK for ob_svall access disabled a test with memoryview again ........ r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line Untested updates to the PCBuild directory ........ r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed. ........ r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines Disabled last failing test I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out. ........ r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytes warning code ........ r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass. ........ r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytearray subclassing - all tests are passing. ........
2008-03-25Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl-6/+10
EOL 80 limit and supply more alternatives in warning messages.
2008-03-19The filter() function does support a None argument in Py3.0.Raymond Hettinger-7/+0
2008-03-18Backport of the print function, using a __future__ import.Eric Smith-0/+73
This work is substantially Anthony Baxter's, from issue 1633807. I just freshened it, made a few minor tweaks, and added the test cases. I also created issue 2412, which is to check for 2to3's behavior with the print function. I also added myself to ACKS.
2008-03-18Added a warning when -3 is enabled and None is passed to filter as the first ↵David Wolever-0/+7
argument.
2008-03-18Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant-0/+1
object and structmodule. But, these need to be finished in Python 3.0 first. No objects support the new buffer API in Python 2.6 as of yet, and except for the memoryview object, I don't think they will.
2008-02-24Add a little info to the 3k deprecation warnings about what to use instead.Neal Norwitz-4/+4
Suggested by Raymond Hettinger.
2008-02-24map(None, ...) is not supported in 3.0.Neal Norwitz-3/+9
2008-02-22Added bin() builtin. I'm going to check in the tests in a seperate checkin, ↵Eric Smith-0/+13
because the builtin doesn't need to be ported to py3k, but the tests are missing in py3k and need to be merged there.
2008-02-17Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith-0/+19
Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k).
2008-02-01Move __builtins__.trunc() to math.trunc() perJeffrey Yasskin-15/+0
http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue 1965.
2008-01-29CallMethod is faster with a NULL third-argument than with an empty format ↵Raymond Hettinger-1/+1
string.
2008-01-23Fix two crashers.Guido van Rossum-1/+6
2008-01-18Added bytes and b'' as aliases for str and ''Christian Heimes-0/+1
2008-01-05Fix C++-style comment.Georg Brandl-3/+3
2008-01-05Continue rolling back pep-3141 changes that changed behavior from 2.5. ThisJeffrey Yasskin-17/+25
round included: * Revert round to its 2.6 behavior (half away from 0). * Because round, floor, and ceil always return float again, it's no longer necessary to have them delegate to __xxx___, so I've ripped that out of their implementations and the Real ABC. This also helps in implementing types that work in both 2.6 and 3.0: you return int from the __xxx__ methods, and let it get enabled by the version upgrade. * Make pow(-1, .5) raise a ValueError again.
2008-01-03Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (justJeffrey Yasskin-23/+30
the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361, r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new documentation. The only significant difference is that round(x) returns a float to preserve backward-compatibility. See http://bugs.python.org/issue1689.
2007-12-20Improve performance of built-in any()/all() by avoiding PyIter_Next() --Guido van Rossum-8/+28
using a trick found in ifilter(). Feel free to backport to 2.5.
2007-12-08Note that open() is the preferred way to open files (issue 1510).Skip Montanaro-1/+2
2007-12-06Fix Issue 1045.Raymond Hettinger-24/+3
Factor-out common calling code by simplifying the length_hint API. Speed-up the function by caching the PyObject_String for the attribute lookup.
2007-10-25Missing DECREFsRaymond Hettinger-0/+2
2007-10-24Fixup error return and add support for intermixed ints and floats/Raymond Hettinger-1/+7
2007-10-24Optimize sum() for integer and float inputs.Raymond Hettinger-0/+70
2007-05-23Add a bunch more deprecation warnings for builtins that are going away in 3.0Neal Norwitz-0/+24
2007-05-23Add -3 option to the interpreter to warn about features that areNeal Norwitz-0/+5
deprecated and will be changed/removed in Python 3.0. This patch is mostly from Anthony. I tweaked some format and added a little doc.