summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* - A new type object, 'string', is added. This is a common base typeGuido van Rossum2002-05-241-0/+1
| | | | | | | for 'str' and 'unicode', and can be used instead of types.StringTypes, e.g. to test whether something is "a string": isinstance(x, string) is True for Unicode and 8-bit strings. This is an abstract base class and cannot be instantiated directly.
* Disambiguate the grammar for backtick.Guido van Rossum2002-05-242-57/+76
| | | | | | The old syntax suggested that a trailing comma was OK inside backticks, but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar to avoid the ambiguity. Fred: you may want to update the refman.
* John Aycock correctly pointed out that the grammar forTim Peters2002-05-231-3/+2
| | | | "power" was formally ambiguous. Here's his fix.
* Fix forMichael W. Hudson2002-05-201-1/+1
| | | | | | | | | | | [ 558249 ] softspace vs --disable-unicode And #endif was in the wrong place. Bugfix candidate, almost surely. I think I will embark on squashing test failures in --disable-unicode builds -- a Real Bug was hiding under them.
* SF bug 555042: zip() may trigger MemoryError.Tim Peters2002-05-121-2/+7
| | | | | NOT a bugfix candidate: this is a fix to an optimization introduced in 2.3.
* builtin_zip(): Take a good guess at how big the result list will be,Tim Peters2002-04-291-15/+42
| | | | | | | and allocate it in one gulp. This isn't a bugfix, it's just a minor optimization that may or may not pay off.
* Repair widespread misuse of _PyString_Resize. Since it's clear peopleTim Peters2002-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | don't understand how this function works, also beefed up the docs. The most common usage error is of this form (often spread out across gotos): if (_PyString_Resize(&s, n) < 0) { Py_DECREF(s); s = NULL; goto outtahere; } The error is that if _PyString_Resize runs out of memory, it automatically decrefs the input string object s (which also deallocates it, since its refcount must be 1 upon entry), and sets s to NULL. So if the "if" branch ever triggers, it's an error to call Py_DECREF(s): s is already NULL! A correct way to write the above is the simpler (and intended) if (_PyString_Resize(&s, n) < 0) goto outtahere; Bugfix candidate.
* - New builtin function enumerate(x), from PEP 279. Example:Guido van Rossum2002-04-261-0/+1
| | | | | enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c"). The argument can be an arbitrary iterable object.
* If Py_OptimizeFlag is false then always evaluate assert conditions, don'tNeil Schemenauer2002-04-261-15/+7
| | | | test __debug__ at runtime. Closes SF patch #548833.
* Ignore SIGXFSZ.Jeremy Hylton2002-04-231-0/+3
| | | | | | | | | | | | The SIGXFSZ signal is sent when the maximum file size limit is exceeded (RLIMIT_FSIZE). Apparently, it is also sent when the 2GB file limit is reached on platforms without large file support. The default action for SIGXFSZ is to terminate the process and dump core. When it is ignored, the system call that caused the limit to be exceeded returns an error and sets errno to EFBIG. Python always checks errno on I/O syscalls, so there is nothing to do with the signal.
* Moving pymalloc along.Tim Peters2002-04-221-2/+2
| | | | | | | | | | | | | | | | | | + Redirect PyMem_{Del, DEL} to the object allocator's free() when pymalloc is enabled. Needed so old extensions can continue to mix PyObject_New with PyMem_DEL. + This implies that pgen needs to be able to see the PyObject_XYZ declarations too. pgenheaders.h now includes Python.h. An implication is that I expect obmalloc.o needs to get linked into pgen on non-Windows boxes. + When PYMALLOC_DEBUG is defined, *all* Py memory API functions now funnel through the debug allocator wrapper around pymalloc. This is the default in a debug build. + That caused compile.c to fail: it indirectly mixed PyMem_Malloc with raw platform free() in one place. This is verbotten.
* ceval.c/do_raise(): Tighten the test to disallow raising an instance ofTim Peters2002-04-181-1/+4
| | | | | | | | a str subclass. test_descr.py/string_exceptions(): New sub-test. For 2.3 only. Guido doesn't want this backported.
* Mass checkin of universal newline support.Jack Jansen2002-04-144-9/+9
| | | | | | | | Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
* Patch #542659: Eliminate duplicate check for NULL of freevars/cellvars.Martin v. Löwis2002-04-141-4/+0
|
* _PyObject_DebugDumpStats: renamed to _PyObject_DebugMallocStats.Tim Peters2002-04-131-0/+5
| | | | | | Added code to call this when PYMALLOC_DEBUG is enabled, and envar PYTHONMALLOCSTATS is set, whenever a new arena is obtained and once late in the Python shutdown process.
* Removed more hair in support of future-generator stmts.Tim Peters2002-04-121-1/+1
|
* Got rid of ifdefs for long-obsolete GUSI versions.Jack Jansen2002-04-111-21/+0
|
* is_builtin() is not a Boolean -- it can return -1, 0, 1. [SF #541652]Guido van Rossum2002-04-091-1/+1
|