summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* A nice little speed-up for filter():Guido van Rossum2002-08-161-13/+17
| | | | | | | | | | - Use PyObject_Call() instead of PyEval_CallObject(), saves several layers of calls and checks. - Pre-allocate the argument tuple rather than calling Py_BuildValue() each time round the loop. - For filter(None, seq), avoid an INCREF and a DECREF.
* Add warnings for arguments named None. All set. (I could add aGuido van Rossum2002-08-161-1/+9
| | | | | | warning for 'global None', but that's either accompanied by an assignment to None, which will trigger a warning, or not, in which case it's harmless. :-)
* Add warning for None used as keyword argument name in function call.Guido van Rossum2002-08-161-0/+1
| | | | | Still to do: function definition arguments (including *None and **None).
* Add warnings for assignment or deletion of variables and attributesGuido van Rossum2002-08-161-0/+27
| | | | | named 'None'. Still to do: function definition parameter lists, and function call keyword arguments.
* Minor cleanup of parsename() and parsestr(): the 'struct compiling *'Guido van Rossum2002-08-161-13/+13
| | | | | | argument should be called 'c', like everywhere else. Renamed a complex variable 'c' to 'z' and moved it inside the only scope where it's used.
* This is my patchMichael W. Hudson2002-08-155-78/+199
| | | | | | | | [ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
* provide less mysterious error messages when seeing end-of-line inSkip Montanaro2002-08-151-0/+6
| | | | | single-quoted strings or end-of-file in triple-quoted strings. closes patch 586561.
* Py_InitModule4(): Accept NULL for the 'methods' argument. This makesFred Drake2002-08-141-14/+16
| | | | | sense now that extension types can support __init__ directly rather than requiring function constructors.
* Added a FutureWarning for constructs that will change semantically inBarry Warsaw2002-08-142-2/+10
| | | | | the future. Changed PEP 237 hex constant warnings from DeprecationWarning to FutureWarning. Updated the documentation.
* Patch #550192: Set softspace to 0 in raw_input().Martin v. Löwis2002-08-141-18/+22
|
* Patch #505705: Remove eval in pickle and cPickle.Martin v. Löwis2002-08-141-98/+5
|
* Use PyErr_WarnExplicit() to warn about hex/oct constants, so theGuido van Rossum2002-08-121-4/+9
| | | | correct filename and line number are reported.
* Reset errno to zero after calling PyErr_Warn(). It can potentially doGuido van Rossum2002-08-111-0/+1
| | | | | a lot of work, including I/O (e.g. to import warnings.py), which might affect errno.
* Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.Marc-André Lemburg2002-08-111-34/+1
| | | | | | | u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581.
* Implement stage B0 of PEP 237: add warnings for operations thatGuido van Rossum2002-08-111-1/+9
| | | | | | | | | | currently return inconsistent results for ints and longs; in particular: hex/oct/%u/%o/%x/%X of negative short ints, and x<<n that either loses bits or changes sign. (No warnings for repr() of a long, though that will also change to lose the trailing 'L' eventually.) This introduces some warnings in the test suite; I'll take care of those later.
* Add weakref support generator-iterators.Fred Drake2002-08-091-1/+7
| | | | Part of fixing SF bug #591704.
* Use Py_FatalError instead of abort.Martin v. Löwis2002-08-071-2/+3
|
* Fix PEP 263 code --without-unicode. Fixes #591943.Martin v. Löwis2002-08-071-0/+10
|
* get rid of GETNAMEV macro - use GETITEM directlySkip Montanaro2002-08-061-12/+11
| | | | same idea as getting rid of GETCONST & GETNAME (see patch #506436)
* small speedup for constant and name accessSkip Montanaro2002-08-041-3/+6
| | | | see sf #506436
* Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis2002-08-043-14/+143
|
* SF patch #578297:Andrew MacIntyre2002-08-041-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the parser and compiler to use PyMalloc. Only the files implementing processes that will request memory allocations small enough for PyMalloc to be a win have been changed, which are:- - Python/compile.c - Parser/acceler.c - Parser/node.c - Parser/parsetok.c This augments the aggressive overallocation strategy implemented by Tim Peters in PyNode_AddChild() [Parser/node.c], in reducing the impact of platform malloc()/realloc()/free() corner case behaviour. Such corner cases are known to be triggered by test_longexp and test_import. Jeremy Hylton, in accepting this patch, recommended this as a bugfix candidate for 2.2. While the changes to Python/compile.c and Parser/node.c backport easily (and could go in), the changes to Parser/acceler.c and Parser/parsetok.c require other not insignificant changes as a result of the differences in the memory APIs between 2.3 and 2.2, which I'm not in a position to work through at the moment. This is a pity, as the Parser/parsetok.c changes are the most important after the Parser/node.c changes, due to the size of the memory requests involved and their frequency.
* Added one call to Py_Main(), for OSX framework builds only, that will get theJack Jansen2002-08-021-0/+88
| | | | | | | | | | | | | actual script to run in case we are running from an applet. If we are indeed running an applet we skip the normal option processing leaving it all to the applet code. This allows us to get use the normal python binary in the Python.app bundle, giving us all the normal command line options through PythonLauncher while still allowing Python.app to be used as the template for building applets. Consequently, pythonforbundle is gone, and Mac/Python/macmain.c isn't used on OSX anymore.
* Whitespace normalization.Thomas Heller2002-07-301-4/+4
|
* Fix SF 588452: debug build crashes on marshal.dumps([128] * 1000).Thomas Heller2002-07-301-6/+6
| | | | | | | | | See there for a description. Added test case. Bugfix candidate for 2.2.x, not sure about previous versions: probably low priority, because virtually no one runs debug builds.
* New functions for extension writers on Windows:Thomas Heller2002-07-291-3/+17
| | | | | | | | | | PyErr_SetExcFromWindowsErr(), PyErr_SetExcFromWindowsErrWithFilename(). Similar to PyErr_SetFromWindowsErrWithFilename() and PyErr_SetFromWindowsErr(), but they allow to specify the exception type to raise. Available on Windows. See SF patch #576458.
* Excise DL_IMPORT/EXPORT from object.h, and related files. This patchMark Hammond2002-07-291-2/+2
| | | | | also adds 'extern' to PyAPI_DATA rather than at each declaration, as discussed with Tim and Guido.
* Patch #554716: Use __va_copy where available.Martin v. Löwis2002-07-282-0/+8
|
* remove spurious SET_LINENO from com_list_for and com_list_if. All they doSkip Montanaro2002-07-251-2/+0
| | | | | | | | | | | is slow things down unnecessarily and make tracing much more verbose. Something like def f(n): return [i for i in range(n) if i%2] should have at most two SET_LINENO instructions, not four. When tracing, the current line number should be printed once, not 2*n+1 times.
* Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.Mark Hammond2002-07-191-5/+0
|
* Fix bug [ 549731 ] Unicode encoders appears to leak references.Mark Hammond2002-07-181-4/+10
| | | | Python 2.2.1 bugfix candidate.
* SF patch 552161 - Py_AddPendingCall doesn't unlock on fail (DanielGuido van Rossum2002-07-171-1/+3
| | | | | | Dunbar) Can't test this, but looks correct to me.
* Removed more stray instances of statichere, but left _sre.c alone.Tim Peters2002-07-171-1/+1
|
* staticforward bites the dust.Jeremy Hylton2002-07-171-1/+1
| | | | | | | | | | | | | | | The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
* There's no need for generators to define an explicit next() method.Tim Peters2002-07-171-22/+1
|
* SF patch # 580411, move frame macros from frameobject.h into ceval.cNeal Norwitz2002-07-141-3/+10
| | | | | remove unused macros use co alias instead of f->f_code in macros
* Don't stomp on an exception set by PyCell_Get()Jeremy Hylton2002-07-111-1/+4
|
* _Py_AskYesNo(): Removed this function. It was defined only in aTim Peters2002-07-091-20/+0
| | | | Py_TRACE_REFS build, but wasn't referenced.
* Fix SF Bug 564931: compile() traceback must include filename.Thomas Heller2002-07-091-2/+27
|
* The Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield: addedTim Peters2002-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | more trivial lexical helper macros so that uses of these guys expand to nothing at all when they're not enabled. This should help sub- standard compilers that can't do a good job of optimizing away the previous "(void)0" expressions. Py_DECREF: There's only one definition of this now. Yay! That was that last one in the family defined multiple times in an #ifdef maze. Py_FatalError(): Changed the char* signature to const char*. _Py_NegativeRefcount(): New helper function for the Py_REF_DEBUG expansion of Py_DECREF. Calling an external function cuts down on the volume of generated code. The previous inline expansion of abort() didn't work as intended on Windows (the program often kept going, and the error msg scrolled off the screen unseen). _Py_NegativeRefcount calls Py_FatalError instead, which captures our best knowledge of how to abort effectively across platforms.
* Rearranged and added comments to object.h, to clarify many thingsTim Peters2002-07-071-2/+3
| | | | | | | | | | | that have taken me "too long" to reverse-engineer over the years. Vastly reduced the nesting level and redundancy of #ifdef-ery. Took a light stab at repairing comments that are no longer true. sys_gettotalrefcount(): Changed to enable under Py_REF_DEBUG. It was enabled under Py_TRACE_REFS, which was much heavier than necessary. sys.gettotalrefcount() is now available in a Py_REF_DEBUG-only build.
* Patch #569753: Remove support for WIN16.Martin v. Löwis2002-06-307-49/+18
| | | | Rename all occurrences of MS_WIN32 to MS_WINDOWS.
* Got rid of an extraneous semicolon.Jack Jansen2002-06-261-1/+1
|
* Silence compiler warningJeremy Hylton2002-06-251-1/+1
|
* SF 569257 -- Name mangle double underscored variable names in __slots__.Raymond Hettinger2002-06-201-6/+6
|
* Fix the docstring for sys.getrefcount().Fred Drake2002-06-201-2/+3
| | | | Closes SF bug #571759.
* PyModule_AddObject(): Added missing exceptions.Fred Drake2002-06-171-7/+14
| | | | Closes SF bug #523473.
* Apply diff2.txt from SF patch http://www.python.org/sf/566999Walter Dörwald2002-06-171-7/+29
| | | | | | | | This patch enhances Python/import.c/find_module() so that unicode objects found in sys.path will be treated as legal directory names (The current code ignores anything that is not a str). The unicode name is converted to str using Py_FileSystemDefaultEncoding.
* SF patch 568629 by Oren Tirosh: types made callable.Guido van Rossum2002-06-143-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These built-in functions are replaced by their (now callable) type: slice() buffer() and these types can also be called (but have no built-in named function named after them) classobj (type name used to be "class") code function instance instancemethod (type name used to be "instance method") The module "new" has been replaced with a small backward compatibility placeholder in Python. A large portion of the patch simply removes the new module from various platform-specific build recipes. The following binary Mac project files still have references to it: Mac/Build/PythonCore.mcp Mac/Build/PythonStandSmall.mcp Mac/Build/PythonStandalone.mcp [I've tweaked the code layout and the doc strings here and there, and added a comment to types.py about StringTypes vs. basestring. --Guido]
* Now FOR_LOOP is gone, loop_subscript can go too.Michael W. Hudson2002-06-141-19/+0
| | | | make -s rules :-)