summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* 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 :-)
* Fix SF bug # 561858 Assertion with very long listsNeal Norwitz2002-06-141-7/+7
| | | | | | | Write 4 bytes for co_stacksize, etc. to prevent writing out bad .pyc files which can cause a crash when read back in. (I forgot that frozen needs to be updated too for the test.)
* Fix SF bug # 561858 Assertion with very long listsNeal Norwitz2002-06-142-12/+12
| | | | | Write 4 bytes for co_stacksize, etc. to prevent writing out bad .pyc files which can cause a crash when read back in.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-133-211/+171
|
* The opcode FOR_LOOP no longer exists.Guido van Rossum2002-06-131-31/+0
|
* SF bug 567538: Generator can crash the interpreter (Finn Bock).Guido van Rossum2002-06-121-2/+2
| | | | | | | | | | This was a simple typo. Strange that the compiler didn't catch it! Instead of WHY_CONTINUE, two tests used CONTINUE_LOOP, which isn't a why_code at all, but an opcode; but even though 'why' is declared as an enum, comparing it to an int is apparently not even worth a warning -- not in gcc, and not in VC++. :-( Will fix in 2.2 too.
* Patch #488073: AtheOS port.Martin v. Löwis2002-06-113-0/+351
|
* Patch #505375: Make doc strings optional.Martin v. Löwis2002-06-091-30/+53
|
* Skip Montanaro's patch, SF 559833, exposing xrange type in builtins.Raymond Hettinger2002-06-051-43/+1
| | | | | Also, added more regression tests to cover the new type and test its conformity with range().
* Change name from string to basestringNeal Norwitz2002-05-311-1/+1
|
* Fix SF bug [ 561825 ] Confusing error for "del f()"Jeremy Hylton2002-05-311-2/+6
| | | | In the error message, say del for del and assign for everything else.
* imp_load_module(): correct and comment the sense of the test for '+'Guido van Rossum2002-05-301-2/+7
| | | | in the mode (it's forbidden).
* Cover a few corners in the 'U' mode integration to make imp work.Jeremy Hylton2002-05-301-8/+14
| | | | | | | | | get_file() must convert 'U' to "r" PY_STDIOTEXTMODE before calling fopen(). imp_load_module() must accept 'r' or 'U' or something with '+'. Also reflow some long lines.
* As discussed on python-dev, add a mechanism to indicate featuresNeal Norwitz2002-05-291-0/+9
| | | | | that are in the process of deprecation (PendingDeprecationWarning). Docs could be improved.
* Accept u"..." literals even when Unicode is disabled. But theseGuido van Rossum2002-05-281-8/+13
| | | | | literals must not contain \u, \U or \N escapes. (XXX Should they also not contain non-ASCII characters?)
* File modes in filedescr entries are also passed to Python, so we now put "U"Jack Jansen2002-05-281-4/+7
| | | | | | | in there, and convert it to "rb" (or "r" for non-universal-newline builds) before passing it to fopen(). Fixes #561326.