summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Fix memory leaksNeal Norwitz2008-03-271-2/+6
|
* Fix bytes so it works on 64-bit platforms.Neal Norwitz2008-03-271-14/+5
| | | | (Also remove some #if 0 code that is already handled in _getbytevalue.)
* Merged revisions ↵Christian Heimes2008-03-269-2/+4489
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* Move declarations to block start.Georg Brandl2008-03-251-4/+4
|
* Fix tabs.Georg Brandl2008-03-252-2/+2
|
* Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl2008-03-259-33/+42
| | | | EOL 80 limit and supply more alternatives in warning messages.
* #2355: py3k warning for buffer().Georg Brandl2008-03-251-0/+5
|
* Try to fix a bunch of compiler warnings on Win64.Neal Norwitz2008-03-251-1/+1
|
* Issue2469: Correct a typo I introduced at r61793: compilation error with ↵Amaury Forgeot d'Arc2008-03-241-1/+1
| | | | | | UCS4 builds. All buildbots compile with UCS2...
* #1477: ur'\U0010FFFF' raised in narrow unicode builds.Amaury Forgeot d'Arc2008-03-231-4/+42
| | | | | Corrected the raw-unicode-escape codec to use UTF-16 surrogates in this case, just like the unicode-escape codec.
* Remove compiler warnings (on Alpha at least) about using chars asNeal Norwitz2008-03-231-4/+4
| | | | | array subscripts. Using chars are dangerous b/c they are signed on some platforms and unsigned on others.
* #2348: add py3k warning for file.softspace.Georg Brandl2008-03-211-2/+34
|
* #2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack ↵Georg Brandl2008-03-212-1/+18
| | | | Diederich.
* Remove unnecessary traceback save/restore pair.Raymond Hettinger2008-03-191-4/+2
|
* Issue 2354: Fix-up compare warning. Patch contributed by Jeff Balogh.Raymond Hettinger2008-03-191-1/+1
|
* Fix compiler warning.Raymond Hettinger2008-03-191-1/+1
|
* Issue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted().Raymond Hettinger2008-03-181-0/+5
|
* Speed-up isinstance() for one easy case.Raymond Hettinger2008-03-181-0/+5
|
* Add py3k warnings for code and method inequality comparisons. This should ↵Steven Bethard2008-03-182-2/+102
| | | | resolve issue 2373. The codeobject.c and methodobject.c changes are both just backports of the Python 3 code.
* cell_compare needs to return -2 instead of NULL.Steven Bethard2008-03-181-1/+1
|
* Add py3k warnings for object, type, cell and dict comparisons. This should ↵Steven Bethard2008-03-184-3/+67
| | | | resolve issue2342 and partly resolve issue2373.
* Remove all traces of HAVE_STRERROR.Brett Cannon2008-03-181-8/+0
| | | | | The removal of strerror.c led to the function check being removed from configure.in.
* Issue 2332: add new attribute names for instance method objectsNeal Norwitz2008-03-181-0/+4
|
* Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant2008-03-182-0/+374
| | | | 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.
* - Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ onGuido van Rossum2008-03-181-0/+12
| | | | exception instances.
* Fix build on platforms that don't have intptr_t. Patch by Joseph Armbruster.Jeffrey Yasskin2008-03-182-2/+2
|
* Fix the IOError message text when opening a file with an invalid filename.Gregory P. Smith2008-03-181-2/+5
| | | | Error reported by Ilan Schnell.
* Issue 2321: reduce memory usage (increase the memory that is returnedNeal Norwitz2008-03-171-17/+21
| | | | | | to the system) by using pymalloc for the data of unicode objects. Will backport.
* Finished backporting PEP 3127, Integer Literal Support and Syntax.Eric Smith2008-03-171-1/+14
| | | | | | | | Added 0b and 0o literals to tokenizer. Modified PyOS_strtoul to support 0b and 0o inputs. Modified PyLong_FromString to support guessing 0b and 0o inputs. Renamed test_hexoct.py to test_int_literal.py and added binary tests. Added upper and lower case 0b, 0O, and 0X tests to test_int_literal.py
* Issue 2264: empty float presentation type needs to have at least one digit ↵Eric Smith2008-03-171-1/+6
| | | | | | | | | past the decimal point. Added "Z" format_char to PyOS_ascii_formatd to support empty float presentation type. Renamed buf_size in PyOS_ascii_formatd to more accurately reflect it's meaning. Modified format.__float__ to use the new "Z" format as the default. Added test cases.
* Issue 705836: Fix struct.pack(">f", 1e40) to behave consistentlyMark Dickinson2008-03-141-8/+8
| | | | | | | | | | across platforms: it should now raise OverflowError on all platforms. (Previously it raised OverflowError only on non IEEE 754 platforms.) Also fix the (already existing) test for this behaviour so that it actually raises TestFailed instead of just referencing it.
* Fix the overflows in expandtabs(). "This time for sure!"Guido van Rossum2008-03-112-50/+65
| | | | (Exploit at request.)
* Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,Jeffrey Yasskin2008-02-281-0/+103
| | | | | | | | which forbids constructing types that have it set. The effect is to speed ./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()' up from 2.5us to 0.201us. This fixes issue 1762.
* Corrected assert to check for correct type in py3k.Eric Smith2008-02-241-1/+1
|
* Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal.Christian Heimes2008-02-242-4/+8
|
* Issue 1742669. Now %d accepts very big float numbers.Facundo Batista2008-02-242-29/+88
| | | | Thanks Gabriel Genellina.
* #2067: file.__exit__() now calls subclasses' close() method.Georg Brandl2008-02-231-2/+2
|
* Now that PyOS_ascii_formatd supports the 'n' format, simplify the float ↵Eric Smith2008-02-201-40/+15
| | | | formatting code to just call it.
* Added code to correct combining str and unicode in ''.format(). Added test ↵Eric Smith2008-02-181-0/+16
| | | | case.
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-1711-23/+2606
| | | | | | | | | | | | | | | 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).
* Prevent a crash with nested scopes, again caused by calling Py_DECREF when ↵Amaury Forgeot d'Arc2008-02-161-1/+3
| | | | | | the pointer is still present in the containing structure.
* Issue #2115: __slot__ attributes setting was 10x slower.Amaury Forgeot d'Arc2008-02-151-1/+1
| | | | | | | | Also correct a possible crash using ABCs. This change is exactly the same as an optimisation done 5 years ago, but on slot *access*: http://svn.python.org/view?view=rev&rev=28297
* In PyNumber_ToBase, changed from an assert to returning an error when ↵Eric Smith2008-02-151-1/+5
| | | | PyObject_Index() returns something other than an int or long. It should never be possible to trigger this, as PyObject_Index checks to make sure it returns an int or long.
* Fixed repr() and str() of complex numbers. Complex suffered from the same ↵Christian Heimes2008-02-151-7/+40
| | | | problem as floats but I forgot to test and fix them.
* Use a static and interned string for __subclasscheck__ and __instancecheck__ ↵Christian Heimes2008-02-141-2/+16
| | | | as suggested by Thomas Heller in #2115
* Implemented Martin's suggestion to clear the free lists during the garbage ↵Christian Heimes2008-02-145-25/+73
| | | | collection of the highest generation.
* dict.copy() rises from the ashes. Revert r60687.Raymond Hettinger2008-02-122-19/+1
|
* Added PyNumber_ToBase and supporting routines _PyInt_Format andEric Smith2008-02-103-33/+113
| | | | | | | | | | | | | | | | | _PyLong_Format. In longobject.c, changed long_format to _PyLong_Format. In intobject.c, changed uses of PyOS_snprintf to _PyInt_Format instead. _PyLong_Format is similar to py3k's routine of the same name, except it has 2 additional parameters: addL and newstyle. addL was existing in long_format, and controls adding the trailing "L". This is unneeded in py3k. newstyle is used to control whether octal prepends "0" (the pre-2.6 style), or "0o" (the 3.0 sytle). PyNumber_ToBase is needed for PEP 3127 (Integer Literal Support and Syntax) and PEP 3101 (Advanced String Formatting). This changeset does not need merging into py3k.
* Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go ↵Raymond Hettinger2008-02-092-1/+19
| | | | away in Py3.x
* Remove unnecessary modulo division.Raymond Hettinger2008-02-081-1/+1
| | | | The preceding test guarantees that 0 <= i < len.