summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
AgeCommit message (Collapse)AuthorLines
2009-12-13account for PyObject_IsInstance's new ability to failBenjamin Peterson-1/+5
2009-12-03Issue #6985: number of range() items should be constrained to lieMark Dickinson-4/+4
in a Py_ssize_t, not an int.
2009-11-24round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this.Mark Dickinson-4/+4
2009-11-18Issue #7117, continued: Change round implementation to use the ↵Mark Dickinson-19/+38
correctly-rounded string <-> float conversions; this makes sure that the result of the round operation is correctly rounded, and hence displays nicely using the new float repr.
2009-11-17a better callable replacementBenjamin Peterson-1/+1
2009-10-26Warn against replacing PyNumber_Add with PyNumber_InPlaceAdd in sumMark Dickinson-0/+9
2009-09-07revert r74699 since it loses useful error informationBenjamin Peterson-2/+13
2009-09-06PyObject_GetIter can set an error for its self just fineBenjamin Peterson-13/+2
2009-07-02when print() gets unicode arguments, sep and end should be unicode by ↵Benjamin Peterson-18/+74
default #4618
2009-05-28further hint to where the open docs really arePhilip Jenvey-1/+1
2009-05-09don't ignore exceptions from _PyObject_LengthHintBenjamin Peterson-1/+3
2009-04-18Issue #1869: Fix a couple of minor round() issues.Mark Dickinson-4/+1
2009-04-02Issue #2396: backport the memoryview object.Antoine Pitrou-1/+1
2009-02-02Issue 1242657: list(obj) can swallow KeyboardInterrupt.Raymond 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.