summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Use fast_next_opcode shortcut for forward jump opcodes (it's safe andNeil Schemenauer2003-06-011-5/+5
| | | | gives a small speedup).
* SF bug #733667: kwargs handled incorrectlyRaymond Hettinger2003-05-311-1/+1
| | | | | The fast_function() inlining optimization only applies when there are zero keyword arguments.
* Don't use fast_next_opcode for JUMP_* opcodes. This fixes the problemNeil Schemenauer2003-05-301-6/+6
| | | | reported by Kurt B. Kaiser.
* Added functions CFObj_New and CFObj_Convert, general functions to convertJack Jansen2003-05-271-0/+3
| | | | between CF objects and their Python representation. Fixes 734695.
* SF bug #644345, Poor error message for augmented assignNeal Norwitz2003-05-221-2/+2
| | | | Update error message. Hopefully this is clearer to some people.
* Use macro to get length of list.Jeremy Hylton2003-05-221-8/+2
| | | | Remove comment about how code used to work.
* Remove comment with very long lines that explained what the code usedJeremy Hylton2003-05-221-3/+3
| | | | | | | to do. XXX Please be careful when checking in patches to avoid checking in junk that explains what the patched code used to do.
* Fix for SF [ 734869 ] Lambda functions in list comprehensionsJeremy Hylton2003-05-212-14/+24
| | | | | | The compiler was reseting the list comprehension tmpname counter for each function, but the symtable was using the same counter for the entire module. Repair by move tmpname into the symtable entry. Bugfix candidate.
* cmp_type(): The grammar stopped allowing '=' as a comparison operatorTim Peters2003-05-121-3/+2
| | | | | about a decade ago. Put the code still allowing for it in cmp_type() out of its lonely misery.
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-101-1/+1
| | | | riscospath.extsep, and use os.extsep throughout.
* Patch #612627: Add encoding attribute to file objects, and determineMartin v. Löwis2003-05-101-0/+43
| | | | the terminal encoding on Windows and Unix.
* Patch #708604: Check more function results. Will backport to 2.2.Martin v. Löwis2003-05-031-7/+37
|
* Patch #684981: Add cleanup capability for argument parsers. Fixes 501716.Martin v. Löwis2003-05-031-28/+90
|
* Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis2003-05-032-0/+47
|
* Patch #729300: Disable error message if Python is not built for threads.Martin v. Löwis2003-05-011-1/+1
|
* Use Tim's suggestion to fixMichael W. Hudson2003-04-291-1/+1
| | | | | | | | | [ 708901 ] Lineno calculation sometimes broken A one line patch to compile.c and a rather-more-than-one-line patch to test_dis. Hey ho. Possibly a backport candidate -- tho' lnotab is less used in 2.2...
* Armin Rigo's fix & test forMichael W. Hudson2003-04-291-9/+10
| | | | | | [ 729622 ] line tracing hook errors with massaging from me to integrate test into test suite.
* Revert the previous enhancement to the bytecode optimizer.Raymond Hettinger2003-04-242-86/+9
| | | | The additional code complexity and new NOP opcode were not worth it.
* some more error-message enhancementsAlex Martelli2003-04-231-10/+10
|
* complete and clarify some error messages for range()Alex Martelli2003-04-231-5/+5
|
* PyGILState cleanup was too early - destructors called via module cleanup may ↵Mark Hammond2003-04-221-5/+5
| | | | use the API.
* fixed a potential refcount bug (thanks Raymond!).Alex Martelli2003-04-221-1/+1
|
* Adding new built-in function sum, with docs and tests.Alex Martelli2003-04-221-0/+61
|
* Improved the bytecode optimizer.Raymond Hettinger2003-04-222-9/+86
| | | | | | | | | | | | | | * Can now test for basic blocks. * Optimize inverted comparisions. * Optimize unary_not followed by a conditional jump. * Added a new opcode, NOP, to keep code size constant. * Applied NOP to previous transformations where appropriate. Note, the NOP would not be necessary if other functions were added to re-target jump addresses and update the co_lnotab mapping. That would yield slightly faster and cleaner bytecode at the expense of optimizer simplicity and of keeping it decoupled from the line-numbering structure.
* handle_system_exit(): This leaked the current exception info, inTim Peters2003-04-191-4/+16
| | | | | | | particular leaving the traceback object (and everything reachable from it) alive throughout shutdown. The patch is mostly from Guido. Bugfix candidate.
* New PyGILState_ API - implements pep 311, from patch 684256.Mark Hammond2003-04-195-81/+265
|
* Patch #716969: Detect thread creation failure. Will backport to 2.2.Martin v. Löwis2003-04-192-9/+9
|
* Patch #711835: Remove unnecessary lock operations. Will backport to 2.2.Martin v. Löwis2003-04-181-8/+4
|
* Roll back changes to 'h' format code -- too much breaks. OtherGuido van Rossum2003-04-181-5/+5
| | | | changes stay.
* dded missing k and K format specifiers to Py_BuildValue and friends.Jack Jansen2003-04-171-0/+6
|
* Oops, 'k' is the new format code for un unchecked 32 bit quantity,Jack Jansen2003-04-171-2/+2
| | | | not 'K'.
* Converted manually written code to the new K format specifier.Jack Jansen2003-04-171-2/+2
| | | | Untested, but at least it still compiles.
* _Py_PrintReferences(): Changed to print object address at start of eachTim Peters2003-04-171-2/+9
| | | | | | | | | | | | | | | new line. New pvt API function _Py_PrintReferenceAddresses(): Prints only the addresses and refcnts of the live objects. This is always safe to call, because it has no dependence on Python's C API. Py_Finalize(): If envar PYTHONDUMPREFS is set, call (the new) _Py_PrintReferenceAddresses() right before dumping final pymalloc stats. We can't print the reprs of the objects here because too much of the interpreter has been shut down. You need to correlate the addresses displayed here with the object reprs printed by the earlier PYTHONDUMPREFS call to _Py_PrintReferences().
* SF # 595026: support for masks in getargs.c.Thomas Heller2003-04-171-27/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New functions: unsigned long PyInt_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); unsigned long PyLong_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); New and changed format codes: b unsigned char 0..UCHAR_MAX B unsigned char none ** h unsigned short 0..USHRT_MAX H unsigned short none ** i int INT_MIN..INT_MAX I * unsigned int 0..UINT_MAX l long LONG_MIN..LONG_MAX k * unsigned long none L long long LLONG_MIN..LLONG_MAX K * unsigned long long none Notes: * New format codes. ** Changed from previous "range-and-a-half" to "none"; the range-and-a-half checking wasn't particularly useful. New test test_getargs2.py, to verify all this.
* - New C API PyGC_Collect(), same as calling gc.collect().Guido van Rossum2003-04-171-0/+8
| | | | | - Call this in Py_Finalize(). - Expand the Misc/NEWS text on PY_LONG_LONG.
* A missing piece of the PEP 269 patch: add PyParser_SetError(), aGuido van Rossum2003-04-171-0/+9
| | | | wrapper around err_input().
* Trimmed trailing whitespace.Tim Peters2003-04-171-10/+10
|
* Py_Finalize(): Reverted recent changes that tried to move theTim Peters2003-04-171-8/+11
| | | | | | | | PYTHONDUMPREFS output after most teardown. Attempts to use PYTHONDUMPREFS with the Zope3 test suite died with Py_FatalError(), since _Py_PrintReferences() can end up executing arbitrary Python code (for objects that override __repr__), and that requires an intact interpreter.
* - pythunrun.c, Py_Finalize(): move the call to _Py_PrintReferences()Guido van Rossum2003-04-152-13/+17
| | | | | | | | | | | | | | | | | | | even farther down, to just before the call to _PyObject_DebugMallocStats(). This required the following changes: - pystate.c, PyThreadState_GetDict(): changed not to raise an exception or issue a fatal error when no current thread state is available, but simply return NULL without raising an exception (ever). - object.c, Py_ReprEnter(): when PyThreadState_GetDict() returns NULL, don't raise an exception but return 0. This means that when printing a container that's recursive, printing will go on and on and on. But that shouldn't happen in the case we care about (see first bullet). - Updated Misc/NEWS and Doc/api/init.tex to reflect changes to PyThreadState_GetDict() definition.
* Move the call to _Py_PrintReferences() a bit further down. ThisGuido van Rossum2003-04-151-7/+12
| | | | | prevents it from showing stuff (like codec state) that is cleared when the interpreter state is cleared.
* Some errors from range() should be TypeError, not ValueError.Guido van Rossum2003-04-151-3/+3
|
* Extend SF patch #707257: Improve code generationRaymond Hettinger2003-04-151-8/+20
| | | | | | to cover the case for: "x,y,z=1,2,3". Gives a 30% speed-up. Also, added FOR_ITER to the list of opcodes that can jump.
* Prompted by Tim's comment, when handle_range_longs() sees anGuido van Rossum2003-04-141-9/+9
| | | | | unexpected type, report the actual type rather than 'float'. (It's hard to even reach this code with a float. :-)
* handle_range_longs(): refcount handling is very delicate here, andTim Peters2003-04-131-31/+50
| | | | | | | the code erroneously decrefed the istep argument in an error case. This caused a co_consts tuple to lose a float constant prematurely, which eventually caused gc to try executing static data in floatobject.c (don't ask <wink>). So reworked this extensively to ensure refcount correctness.
* Patch by Chad Netzer (with significant change):Guido van Rossum2003-04-111-5/+190
| | | | | | | - range() now works even if the arguments are longs with magnitude larger than sys.maxint, as long as the total length of the sequence fits. E.g., range(2**100, 2**101, 2**100) is the following list: [1267650600228229401496703205376L]. (SF patch #707427.)
* Move declaration of enc to scope where it is usedNeal Norwitz2003-04-101-2/+1
|
* PyErr_NormalizeException(): in the type==NULL test, we should simplyGuido van Rossum2003-04-101-3/+2
| | | | | | | | return. Setting an exception can mess with the exception state, and continuing is definitely wrong (since type is dereferenced later on). Some code that calls this seems to be prepared for a NULL exception type, so let's be safe rather than sorry and simply assume there's nothing to normalize in this case.
* - New function sys.call_tracing() allows pdb to debug codeGuido van Rossum2003-04-092-0/+37
| | | | | | recursively. - pdb has a new command, "debug", which lets you step through arbitrary code from the debugger's (pdb) prompt.
* SF patch #701494: more apply removalsRaymond Hettinger2003-04-061-1/+4
|
* Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.Martin v. Löwis2003-03-292-7/+7
|