summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Issue #7117: Backport missing pystrtod.h declarations from py3k.Mark Dickinson2009-10-261-0/+5
|
* Finished removing _PyOS_double_to_string, as mentioned in issue 7117.Eric Smith2009-10-261-7/+0
|
* Issue #7117: temporarily disable the short float repr while theMark Dickinson2009-10-241-0/+7
| | | | | pieces are being assembled. To re-enable, define the preprocessor symbol PY_SHORT_FLOAT_REPR
* Issue #7117 (backport py3k float repr) continued:Mark Dickinson2009-10-243-0/+85
| | | | | | | | | - add double endianness detection to configure script - add configure-time check to see whether we can use inline assembly to get and set x87 control word in configure script - add functions to get and set x87 control word in Python/pymath.c - add pyport.h logic to determine whether it's safe to use the short float repr or not
* Issue #7117: Prepare for backport of py3k float repr.Mark Dickinson2009-10-242-0/+16
| | | | | | | Add the Python/dtoa.c file containing the main algorithms; add corresponding include file and include in Python.h; include license information for Python/dtoa.c; add dtoa.c and dtoa.h to Makefile.
* http://bugs.python.org/issue6836Kristján Valur Jónsson2009-09-282-3/+10
| | | | The debug memory api now keeps track of which external API (PyMem_* or PyObject_*) was used to allocate each block and treats any API violation as an error. Added separate _PyMem_DebugMalloc functions for the Py_Mem API instead of having it use the _PyObject_DebugMalloc functions.
* Issue #6713: Improve performance of str(n) and repr(n) for integers nMark Dickinson2009-09-161-0/+4
| | | | | (up to 3.1 times faster in tests), by special-casing base 10 in _PyLong_Format. (Backport of r74851 from py3k.)
* Fix issue #1590864, multiple threads and fork() can cause deadlocks, byThomas Wouters2009-09-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | acquiring the import lock around fork() calls. This prevents other threads from having that lock while the fork happens, and is the recommended way of dealing with such issues. There are two other locks we care about, the GIL and the Thread Local Storage lock. The GIL is obviously held when calling Python functions like os.fork(), and the TLS lock is explicitly reallocated instead, while also deleting now-orphaned TLS data. This only fixes calls to os.fork(), not extension modules or embedding programs calling C's fork() directly. Solving that requires a new set of API functions, and possibly a rewrite of the Python/thread_*.c mess. Add a warning explaining the problem to the documentation in the mean time. This also changes behaviour a little on AIX. Before, AIX (but only AIX) was getting the import lock reallocated, seemingly to avoid this very same problem. This is not the right approach, because the import lock is a re-entrant one, and reallocating would do the wrong thing when forking while holding the import lock. Will backport to 2.6, minus the tiny AIX behaviour change.
* Issue #6848: Fix curses module build failure on OS X 10.6.Mark Dickinson2009-09-061-1/+6
|
* Issue #6347: Add inttypes.h to the pyport.h #includes; fixes a buildMark Dickinson2009-06-301-0/+6
| | | | failure on HP-UX 11.00.
* Remove unused stdint.h includesMark Dickinson2009-06-282-8/+0
|
* remove some unused symtable constantsBenjamin Peterson2009-06-231-7/+3
|
* remove tmpname support since it's no longer usedBenjamin Peterson2009-06-211-2/+0
|
* Add const qualifier to PyErr_SetFromErrnoWithFilename and toAlexandre Vassalotti2009-06-121-2/+3
| | | | PyErr_SetFromErrnoWithUnicodeFilename.
* Allow multiple context managers in one with statement, as proposedGeorg Brandl2009-05-251-1/+1
| | | | | | | in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics.
* add a SETUP_WITH opcodeBenjamin Peterson2009-05-251-1/+3
| | | | | It speeds up the with statement and correctly looks up the special methods involved.
* Issue #6042:Jeffrey Yasskin2009-05-231-9/+6
| | | | | | | | | | | | | | | lnotab-based tracing is very complicated and isn't documented very well. There were at least 3 comment blocks purporting to document co_lnotab, and none did a very good job. This patch unifies them into Objects/lnotab_notes.txt which tries to completely capture the current state of affairs. I also discovered that we've attached 2 layers of patches to the basic tracing scheme. The first layer avoids jumping to instructions that don't start a line, to avoid problems in if statements and while loops. The second layer discovered that jumps backward do need to trace at instructions that don't start a line, so it added extra lnotab entries for 'while' and 'for' loops, and added a special case for backward jumps within the same line. I replaced these patches by just treating forward and backward jumps differently.
* Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.Hirokazu Yamamoto2009-05-171-7/+3
|
* Issue 5954, PyFrame_GetLineNumber:Jeffrey Yasskin2009-05-082-2/+11
| | | | | | | | | | | | | | Most uses of PyCode_Addr2Line (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get the line number of a specified frame, but there's no way to do that directly. Forcing people to go through the code object makes them know more about the guts of the interpreter than they should need. The remaining uses of PyCode_Addr2Line seem to be getting the line from a traceback (for example, http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line), which is replaced by the tb_lineno field. So we may be able to deprecate PyCode_Addr2Line entirely for external use.
* PyCode_NewEmpty:Jeffrey Yasskin2009-05-081-0/+5
| | | | | | | | Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New are trying to build an empty code object, usually to put it in a dummy frame object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify just the filename, function name, and first line number, instead of also requiring lots of code internals.
* add _PyObject_LookupSpecial to handle fetching special method lookupBenjamin Peterson2009-05-081-0/+1
|
* Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith2009-05-051-0/+6
| | | | precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
* Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal ↵Antoine Pitrou2009-05-041-4/+2
| | | | | | sequences. Patch by Nick Barnes and Victor Stinner.
* Issue #1588: Add complex.__format__.Eric Smith2009-04-301-0/+6
|
* Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to ↵Eric Smith2009-04-273-22/+42
| | | | py3k. Should fix Windows buildbot errors.
* Issue #5835, deprecate PyOS_ascii_formatd.Eric Smith2009-04-251-1/+11
| | | | | | If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great. Will port to py3k with a different strategy.
* Backport of some of the work in r71665 to trunk. This reworks much ofEric Smith2009-04-222-6/+35
| | | | | | | | | | | | | | | | | | | | | int, long, and float __format__(), and it keeps their implementation in sync with py3k. Also added PyOS_double_to_string. This is the "fallback" version that's also available in trunk, and should be kept in sync with that code. I'll add an issue to document PyOS_double_to_string in the C API. There are many internal cleanups. Externally visible changes include: - Implement PEP 378, Format Specifier for Thousands Separator, for floats, ints, and longs. - Issue #5515: 'n' formatting for ints, longs, and floats handles leading zero formatting poorly. - Issue #5772: For float.__format__, don't add a trailing ".0" if we're using no type code and we have an exponent.
* Fix for issue5657.Ronald Oussoren2009-04-191-0/+12
|
* many more types to initialize (I had to expose some of them)Benjamin Peterson2009-04-182-0/+4
|
* Backport r71704 (add configure check for C99 round function) to trunk.Mark Dickinson2009-04-181-0/+4
|
* Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'Matthias Klose2009-04-051-2/+2
| | | | to avoid compiler warnings.
* - Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.Matthias Klose2009-04-051-5/+7
| | | | (avoiding brown paper typo this time)
* revert r71159 since it broke the buildBenjamin Peterson2009-04-041-7/+5
|
* - Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.Matthias Klose2009-04-041-5/+7
|
* Issue #2396: backport the memoryview object.Antoine Pitrou2009-04-023-14/+90
|
* Fix two issues introduced by issue #71031 by changing the signature ofBrett Cannon2009-04-021-1/+1
| | | | PyImport_AppendInittab() to take a const char *.
* Issue #4688: Add a heuristic so that tuples and dicts containing onlyAntoine Pitrou2009-03-233-0/+13
| | | | | | | | | untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes. (trivia: this makes the "binary_trees" benchmark from the Computer Language Shootout 40% faster)
* Rewrite Py_ARITHMETIC_RIGHT_SHIFT so that it's valid for all signedMark Dickinson2009-03-201-7/+11
| | | | integer types T, not just those for which "unsigned T" is legal.
* Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.Mark Dickinson2009-03-204-18/+106
| | | | Backport of r70459.
* Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} withJeffrey Yasskin2009-02-281-3/+6
| | | | | | POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
* remove some PyBytes_* aliases that are not in 3.xBenjamin Peterson2009-02-161-6/+0
|
* A few more minor fixes in longobject.cMark Dickinson2009-02-151-0/+1
|
* Issue #5260: Various portability and standards compliance fixes, optimizationsMark Dickinson2009-02-151-2/+1
| | | | | | | and cleanups in Objects/longobject.c. The most significant change is that longs now use less memory: average savings are 2 bytes per long on 32-bit systems and 6 bytes per long on 64-bit systems. (This memory saving already exists in py3k.)
* Issue #5204: Define _PyVerify_fd on VC6 to makeHirokazu Yamamoto2009-02-111-0/+3
| | | | test_fdopen (test_os.py) pass.
* Issue 4804. Add a function to test the validity of file descriptors on ↵Kristján Valur Jónsson2009-02-101-0/+11
| | | | Windows, and stop using global runtime settings to silence the warnings / assertions.
* Issue #4575: fix Py_IS_INFINITY macro to work correctly on x87 FPUs.Mark Dickinson2009-02-091-5/+24
| | | | It now forces its argument to double before testing for infinity.
* Issue 1242657: list(obj) can swallow KeyboardInterrupt.Raymond Hettinger2009-02-021-1/+1
|
* #3720: Interpreter crashes when an evil iterator removes its own next function.Amaury Forgeot d'Arc2009-01-122-1/+3
| | | | | | 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.
* Fix issue 4884, preventing a crash in the socket code when python is compiledJeffrey Yasskin2009-01-091-0/+9
| | | | with llvm-gcc and run with a glibc <2.10.
* Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declarationMarc-André Lemburg2009-01-051-10/+28
| | | | | | | into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again.