summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* NIL => NULLBenjamin Peterson2008-03-281-1/+1
|
* Patch #1810 by Thomas Lee, reviewed by myself:Georg Brandl2008-03-281-0/+2
| | | | | allow compiling Python AST objects into code objects in compile().
* Revert r61969 which added casts to Py_CHARMASK to avoid compiler warnings.Neal Norwitz2008-03-282-8/+8
| | | | | | Rather than sprinkle casts throughout the code, change Py_CHARMASK to always cast it's result to an unsigned char. This should ensure we do the right thing when accessing an array with the result.
* Fix warnings about using char as an array subscript. This is not portableNeal Norwitz2008-03-271-7/+7
| | | | since char is signed on some platforms and unsigned on others.
* Patch #2477: Added from __future__ import unicode_literalsChristian Heimes2008-03-264-1/+12
| | | | The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
* Merged revisions ↵Christian Heimes2008-03-266-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* Backport of the print function, using a __future__ import.Eric Smith2008-03-184-2/+9
| | | | | | | | 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.
* Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant2008-03-182-3/+5
| | | | 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.
* Add necessary headers to back-port new buffer protocol to Python 2.6Travis E. Oliphant2008-03-173-0/+173
|
* Set things up for 2.6a2.Barry Warsaw2008-03-011-1/+1
|
* Bump to version 2.6a1Barry Warsaw2008-03-011-2/+2
|
* Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,Jeffrey Yasskin2008-02-281-0/+3
| | | | | | | | 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.
* Thomas Herve explained to me that PyCrypto depends on the constants. I'm ↵Christian Heimes2008-02-251-1/+6
| | | | adding the aliases because C code for Python 2.x should compile under 2.6 as well. The aliases aren't available in Python 3.x though.
* Patch #1759: Backport of PEP 3129 class decoratorsChristian Heimes2008-02-232-84/+87
| | | | with some help from Georg
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-173-0/+31
| | | | | | | | | | | | | | | 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).
* Implemented Martin's suggestion to clear the free lists during the garbage ↵Christian Heimes2008-02-145-0/+11
| | | | collection of the highest generation.
* Forgot to modify header file in r60707.Eric Smith2008-02-101-0/+9
|
* Added PyNumber_ToBase and supporting routines _PyInt_Format andEric Smith2008-02-102-0/+13
| | | | | | | | | | | | | | | | | _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.
* Deallocate content of the dict free list on interpreter shutdownChristian Heimes2008-02-081-0/+1
|
* Patch #1953Christian Heimes2008-02-042-0/+5
| | | | | I implemented the function sys._compact_freelists() and C API functions PyInt_/PyFloat_CompactFreeList() to compact the pre-allocated blocks of ints and floats. They allow the user to reduce the memory usage of a Python process that deals with lots of numbers. The patch also renames sys._cleartypecache to sys._clear_type_cache
* Make int() and long() fall back to __trunc__(). See issue 2002.Jeffrey Yasskin2008-02-041-0/+13
|
* Nasty typo in setobject.hAmaury Forgeot d'Arc2008-02-031-1/+1
|
* Ensure that PySet_Add() operates on a newly created frozenset, like ↵Amaury Forgeot d'Arc2008-02-031-1/+5
| | | | | | | | PyTuple_SetItem does. Add PyFrozenSet_Check(), which was not needed before; The list of Py*Set_Check* macros seems to be complete now. Add missing NEWS entries about all this.
* Fixed bug #1983: Return from fork() is pid_t, not intChristian Heimes2008-01-311-1/+5
|
* Patch #1970 by Antoine Pitrou: Speedup unicode whitespace and linebreak ↵Christian Heimes2008-01-301-1/+8
| | | | detection. The speedup is about 25% for split() (571 / 457 usec) and 35% (175 / 127 usec )for splitlines()
* Factor-out common code with a new macroRaymond Hettinger2008-01-281-0/+2
|
* Added clear cache methods to clear the internal type lookup cache for ref ↵Christian Heimes2008-01-271-0/+1
| | | | leak test runs.
* Add stdarg include for va_list to get this to compile on cygwinNeal Norwitz2008-01-271-0/+2
|
* #1473257: add generator.gi_code attribute that refers toGeorg Brandl2008-01-261-0/+3
| | | | the original code object backing the generator. Patch by Collin Winter.
* Backport of several functions from Python 3.0 to 2.6 including ↵Christian Heimes2008-01-253-7/+33
| | | | | | | PyUnicode_FromString, PyUnicode_Format and PyLong_From/AsSsize_t. The functions are partly required for the backport of the bytearray type and _fileio module. They should also make it easier to port C to 3.0. First chapter of the Python 3.0 io framework back port: _fileio The next step depends on a working bytearray type which itself depends on a backport of the nwe buffer API.
* Don't repeat yourselfChristian Heimes2008-01-221-1/+2
| | | | Added the macros PyModule_AddIntMacro and PyModule_AddStringMacro. They shorten PyModule_AddIntConstant(m, "AF_INET", AF_INET) to PyModule_AddIntMacro(m, AF_INET)
* Fixed a missing (X) in defineChristian Heimes2008-01-221-1/+1
|
* Patch #1720595: add T_BOOL to the range of structmember types.Georg Brandl2008-01-211-0/+3
| | | | Patch by Angelo Mottola, reviewed by MvL, tests by me.
* Fixed a wrong assumption in configure.in and Include/pyport.h. The is finite ↵Christian Heimes2008-01-201-2/+2
| | | | function is not called isfinite() but finite(). Sorry, my fault. :)
* Re-apply patch #1700288 (first applied in r59931, rolled back in r59940)Amaury Forgeot d'Arc2008-01-141-0/+8
| | | | | | now that ctypes uses a more supported method to create types: Method cache optimization, by Armin Rigo, ported to 2.6 by Kevin Jacobs.
* Back out r59931 - test_ctypes fails with it.Georg Brandl2008-01-131-8/+0
|
* Patch #1700288: Method cache optimization, by Armin Rigo, ported toGeorg Brandl2008-01-121-0/+8
| | | | 2.6 by Kevin Jacobs.
* Patch #602345 by Neal Norwitz and me: add -B option and ↵Georg Brandl2008-01-071-0/+1
| | | | PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
* Modified PyImport_Import and PyImport_ImportModule to always use absolute ↵Christian Heimes2008-01-032-5/+2
| | | | | | imports by calling __import__ with an explicit level of 0 Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
* Some build bots don't compile mathmodule. There is an issue with the long ↵Christian Heimes2008-01-031-2/+9
| | | | definition of pi and euler
* Patch #1583 by Adam Olsen.Guido van Rossum2007-12-191-0/+3
| | | | | | | This adds signal.set_wakeup_fd(fd) which sets a file descriptor to which a zero byte will be written whenever a C exception handler runs. I added a simple C API as well, PySignal_SetWakeupFd(fd).
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-1932-74/+79
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Applied patch #1635: Float patch for inf and nan on Windows (and other ↵Christian Heimes2007-12-183-0/+56
| | | | | | platforms). The patch unifies float("inf") and repr(float("inf")) on all platforms.
* Give meaning to the oparg for BUILD_MAP: estimated size of the dictionary.Raymond Hettinger2007-12-181-0/+1
| | | | | | | | | | | Allows dictionaries to be pre-sized (upto 255 elements) saving time lost to re-sizes with their attendant mallocs and re-insertions. Has zero effect on small dictionaries (5 elements or fewer), a slight benefit for dicts upto 22 elements (because they had to resize once anyway), and more benefit for dicts upto 255 elements (saving multiple resizes during the build-up and reducing the number of collisions on the first insertions). Beyond 255 elements, there is no addional benefit.
* Speed-up dictionary constructor by about 10%.Raymond Hettinger2007-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | New opcode, STORE_MAP saves the compiler from awkward stack manipulations and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem. Old disassembly: 0 BUILD_MAP 0 3 DUP_TOP 4 LOAD_CONST 1 (1) 7 ROT_TWO 8 LOAD_CONST 2 ('x') 11 STORE_SUBSCR 12 DUP_TOP 13 LOAD_CONST 3 (2) 16 ROT_TWO 17 LOAD_CONST 4 ('y') 20 STORE_SUBSCR New disassembly: 0 BUILD_MAP 0 3 LOAD_CONST 1 (1) 6 LOAD_CONST 2 ('x') 9 STORE_MAP 10 LOAD_CONST 3 (2) 13 LOAD_CONST 4 ('y') 16 STORE_MAP
* Backport of r59456:59458 from py3k to trunkChristian Heimes2007-12-101-0/+4
| | | | | | Issue #1580: New free format floating point representation based on "Floating-Point Printer Sample Code", by Robert G. Burger. For example repr(11./5) now returns '2.2' instead of '2.2000000000000002'. Thanks to noam for the patch! I had to modify doubledigits.c slightly to support X64 and IA64 machines on Windows. I also added the new file to the three project files.
* Fix Issue 1045.Raymond Hettinger2007-12-061-17/+4
| | | | | Factor-out common calling code by simplifying the length_hint API. Speed-up the function by caching the PyObject_String for the attribute lookup.
* Feature #1534Christian Heimes2007-12-011-0/+4
| | | | | Added PyFloat_GetMax(), PyFloat_GetMin() and PyFloat_GetInfo() to the float API. Added a dictionary sys.float_info with information about the internal floating point type to the sys module.
* Backport of the PCbuild9 directory from the py3k branch.Christian Heimes2007-11-221-2/+2
| | | | | I've finished the last task for the PCbuild9 directory today. I don't think there is much left to do. Now you can all play around with the shiny new VS 2008 and try the PGO builds. I was able to get a speed improvement of about 10% on py3k. Have fun! :)
* The incremental decoder for utf-7 must preserve its state between calls.Amaury Forgeot d'Arc2007-11-201-0/+7
| | | | | | | Solves issue1460. Might not be a backport candidate: a new API function was added, and some code may rely on details in utf-7.py.