summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Have set conversion replace existing constant if not used elsewhere.Raymond Hettinger2005-02-091-1/+7
|
* Close the discussion in SF bug 1069160.Guido van Rossum2005-02-081-1/+3
|
* Adopt Skip's idea to optimize lists of constants in the contextRaymond Hettinger2005-02-071-7/+13
| | | | of a "in" or "not in" test.
* Transform "x in (1,2,3)" to "x in frozenset([1,2,3])".Raymond Hettinger2005-02-061-1/+48
| | | | | Inspired by Skip's idea to recognize the throw-away nature of sequences in this context and to transform their type to one with better performance.
* Fix bug that allowed future statements virtually anywhere in a module.Jeremy Hylton2005-02-041-2/+1
| | | | | | | If we exit via the break here, we need to set ff_last_lineno or FUTURE_POSSIBLE() will remain true. The bug affected statements containing a variety of expressions, but not all expressions. It has been present since Python 2.2.
* Partially revert #1074011; don't try to fflush stdin.Martin v. Löwis2005-01-271-1/+10
| | | | Backported to 2.3 and 2.4.
* Do not fold a constant if a large sequence will result.Raymond Hettinger2005-01-261-5/+15
| | | | Saves space in the presence of code like: (None,)*10000
* happy new year! (on the trunk)Anthony Baxter2005-01-251-1/+1
|
* Flush std{in,out,err} before closing it. Fixes #1074011.Martin v. Löwis2005-01-231-3/+10
| | | | Will backport to 2.4 and 2.3.
* Change the name of the macro used by --with-tsc builds to the lessMichael W. Hudson2005-01-181-29/+32
| | | | inscrutable READ_TIMESTAMP.
* -X died some time ago; remove a tiny bit of associated cruft.Michael W. Hudson2005-01-181-4/+0
|
* make thread stack size compile-time tunable on OS/2Andrew MacIntyre2005-01-171-1/+5
|
* remove unused variableFred Drake2005-01-121-1/+0
|
* SF 1098985: set objects cannot be marshalledRaymond Hettinger2005-01-111-1/+66
|
* comment tweakSkip Montanaro2005-01-081-1/+1
|
* Re-running python with/without the -Qnew flag uses incorrectly optimizedArmin Rigo2005-01-071-6/+3
| | | | | bytecodes from the previously saved .pyc files. Fixed by disabling the static optimization of BINARY_DIVIDE between two constants.
* Teach the peephole optimizer to fold simple constant expressions.Raymond Hettinger2005-01-021-1/+118
|
* Any call to marshal.dumps() with the new optional argument 'version' justArmin Rigo2004-12-201-1/+1
| | | | | immediately segfaults, due to a typo! This was obviously never tested... Added a test for it, and also fixed the documentation.
* Put parentheses around the assignment in the 'while' loop conditionalBrett Cannon2004-12-071-1/+1
| | | | expression in min_max() to shut gcc up.
* SF patch #1077353: add key= argument to min and maxRaymond Hettinger2004-12-031-39/+71
| | | | (First draft of patch contributed by Steven Bethard.)
* Hye-Shik Chang's fix for Bug 875692.Kurt B. Kaiser2004-11-231-0/+6
| | | | | | | | | Improve signal handling, especially when using threads, by forcing an early re-execution of PyEval_EvalFrame() "periodic" code when things_to_do is not cleared by Py_MakePendingCalls(). M Misc/NEWS M Python/ceval.c
* SF bug 1061968: threads: segfault or Py_FatalError at exitTim Peters2004-11-081-13/+12
| | | | | | | | | | | | | | | | | PyGILState_Ensure(): The fix in 2.4a3 for bug 1010677 reintroduced thread shutdown race bug 225673. Repaired by (once again) ensuring the GIL is held whenever deleting a thread state. Alas, there's no useful test case for this shy bug. Four years ago, only Guido could provoke it, on his box, and today only Armin can provoke it on his box. I've never been able to provoke it (but not for lack of trying!). This is a critical fix for 2.3.5 too, since the fix for 1010677 got backported there already and so also reintroduced 225673. I don't intend to backport this fix. For whoever (if anyone) does, there are other thread fixes in 2.4 that need backporting too, and I bet they need to happen first for this patch to apply cleanly.
* SF patch 1025636: Check for NULL returns in compile.c:com_import_stmtJeremy Hylton2004-11-071-4/+14
| | | | There is no test for this change, because there is no way to provoke memory errors on demand. Test suite passes, though.
* SF patch #1035255: Remove CoreServices / CoreFoundation dependencies in coreRaymond Hettinger2004-11-051-158/+67
| | | | | | | | | | | | | (Contributed by Bob Ippolito.) This patch trims down the Python core on Darwin by making it independent of CoreFoundation and CoreServices. It does this by: Changed linker flags in configure/configure.in Removed the unused PyMac_GetAppletScriptFile Moved the implementation of PyMac_StrError to the MacOS module Moved the implementation of PyMac_GetFullPathname to the Carbon.File module
* Maintain peepholer's cumlc invariant by updating the running totalRaymond Hettinger2004-11-021-0/+4
| | | | | | everytime a LOAD_CONSTANT is encountered, created, or overwritten. Added two tests to cover cases affected by the patch.
* Simplify and future proof NOP counting in the peepholer.Raymond Hettinger2004-11-011-13/+6
| | | | No longer assumes that the input is NOP free.
* Fixed a comment and added another one.Armin Rigo2004-10-301-1/+4
|
* Adopt some peepholer suggestions from Armin Rigo:Raymond Hettinger2004-10-301-15/+20
| | | | | | | | * Use simpler, faster two pass algorithm for markblocks(). * Free the blocks variable if not NULL and exiting without change. * Verify that the rest of the compiler has not set an exception. * Make the test for tuple of constants less restrictive. * Embellish the comment for chained conditional jumps.
* SF bug #1053819: Segfault in tuple_of_constantsRaymond Hettinger2004-10-261-1/+9
| | | | | | | Peepholer could be fooled into misidentifying a tuple_of_constants. Added code to count consecutive occurrences of LOAD_CONST. Use the count to weed out the misidentified cases. Added a unittest.
* SF bug #1048870: call arg of lambda not updatingRaymond Hettinger2004-10-241-0/+2
|
* Patch #975056 - fixes for restartable signals on *BSD. In addition,Anthony Baxter2004-10-131-24/+19
| | | | a few remaining calls to signal() were converted to PyOS_setsig().
* SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by NickTim Peters2004-10-112-4/+6
| | | | | Coghlan, for determining whether PyEval_InitThreads() has been called. Also purged the undocumented+unused _PyThread_Started int.
* Revert rev 2.35. It was based on erroneous reasoning -- the currentTim Peters2004-10-101-15/+8
| | | | | | | thread's id can't get duplicated, because (of course!) the current thread is still running. The code should work either way, but reverting the gratuitous change should make backporting easier, and gets the bad reasoning out of 2.35's new comments.
* PyInterpreterState_New(), PyThreadState_New(): use malloc/free directly.Tim Peters2004-10-101-4/+16
| | | | | | This appears to finish repairs for SF bug 1041645. This is a critical bugfix.
* find_key(): This routine wasn't thread-correct, and accounts for theTim Peters2004-10-101-5/+17
| | | | | | release-build failures noted in bug 1041645. This is a critical bugfix. I'm not going to backport it, though (no time).
* PyGILState_Release(): If we need to delete the TLS entry for this thread,Tim Peters2004-10-091-8/+15
| | | | | that must be done under protection of the GIL, for reasons explained in new comments.
* _PyGILState_Init(), PyGILState_Ensure(): Since PyThread_set_key_value()Tim Peters2004-10-091-2/+5
| | | | | | | | | can fail, check its return value, and die if it does fail. _PyGILState_Init(): Assert that the thread doesn't already have an association for autoTLSkey. If it does, PyThread_set_key_value() will ignore the attempt to (re)set the association, which the code clearly doesn't want.
* Document the results of painful reverse-engineering of the "portable TLS"Tim Peters2004-10-091-6/+84
| | | | | | | | | code. PyThread_set_key_value(): It's clear that this code assumes the passed-in value isn't NULL, so document that it must not be, and assert that it isn't. It remains unclear whether existing callers want the odd semantics actually implemented by this function.
* Style guide & consistency changes. No semantic changes.Tim Peters2004-10-092-29/+41
|
* Trim trailing whitespace.Tim Peters2004-10-091-8/+8
|
* SF patch #1035498: -m option to run a module as a scriptRaymond Hettinger2004-10-071-0/+16
| | | | (Contributed by Nick Coghlan.)
* Finalize the freelist of list objects.Raymond Hettinger2004-10-071-0/+1
|
* Print verbose messages to stderr. Fixes #1036752.Martin v. Löwis2004-10-031-1/+2
|
* Improve error message for augmented assignments to genexps or listcomps.Raymond Hettinger2004-09-291-2/+2
| | | | | Rather than introduce new logic, took the approach of making the message itself more general.
* Fix two erroneous error messages.Raymond Hettinger2004-09-291-2/+2
|
* Replaced a test with an assertion.Raymond Hettinger2004-09-281-3/+1
| | | | (Suggested by Michael Hudson.)
* Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders.Phillip J. Eby2004-09-231-4/+10
|
* SF patch #1031667: Fold tuples of constants into a single constantRaymond Hettinger2004-09-222-12/+93
| | | | | | | | Example: >>> import dis >>> dis.dis(compile('1,2,3', '', 'eval')) 0 0 LOAD_CONST 3 ((1, 2, 3)) 3 RETURN_VALUE
* SF bug #1014215: Unspecific errors with metaclassRaymond Hettinger2004-09-161-4/+16
| | | | | | | | | | | | | | High level error message was stomping useful detailed messages from lower level routines. The new approach is to augment string error messages returned by the low level routines. The provides both high and low level information. If the exception value is not a string, no changes are made. To see the improved messages in action, type: import random class R(random): pass class B(bool): pass
* SF patch #1007189, multi-line imports, for instance:Anthony Baxter2004-08-313-826/+897
| | | | | "from blah import (foo, bar baz, bongo)"