summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Move Unicode finalization further down in the chain.Marc-André Lemburg2002-04-081-5/+5
| | | | Fixes bug #525620.
* Return bools from functions named is_<whatever>().Guido van Rossum2002-04-071-4/+4
|
* Fix by Greg Chapman from SF bug 534347: Potential AV in vgetargskeywords.Guido van Rossum2002-04-041-1/+7
| | | | Bugfix candidate.
* Add the 'bool' type and its values 'False' and 'True', as described inGuido van Rossum2002-04-032-8/+27
| | | | | | | | | | | | | PEP 285. Everything described in the PEP is here, and there is even some documentation. I had to fix 12 unit tests; all but one of these were printing Boolean outcomes that changed from 0/1 to False/True. (The exception is test_unicode.py, which did a type(x) == type(y) style comparison. I could've fixed that with a single line using issubtype(x, type(y)), but instead chose to be explicit about those places where a bool is expected. Still to do: perhaps more documentation; change standard library modules to return False/True from predicates.
* Get rid of another use of PyArg_Parse()Neal Norwitz2002-04-011-2/+2
|
* Use symbolic METH_VARARGS instead of 1 for ml_flagsNeal Norwitz2002-03-312-20/+20
|
* Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.Tim Peters2002-03-291-2/+0
|
* Call PyObject_GC_UnTrack before putting an object on the list of trash.Neil Schemenauer2002-03-291-2/+2
|
* add comment reminding people about class hierarchy in Doc/lib/libexcs.texSkip Montanaro2002-03-281-0/+5
|
* Fix an issue that was reported in but unrelated to the main problem ofGuido van Rossum2002-03-281-2/+10
| | | | | | | | | | | | | SF bug 535905 (Evil Trashcan and GC interaction). The SETLOCAL() macro should not DECREF the local variable in-place and then store the new value; it should copy the old value to a temporary value, then store the new value, and then DECREF the temporary value. This is because it is possible that during the DECREF the frame is accessed by other code (e.g. a __del__ method or gc.collect()) and the variable would be pointing to already-freed memory. BUGFIX CANDIDATE!
* Introduce two new flag bits that can be set in a PyMethodDef methodFred Drake2002-03-281-0/+7
| | | | | | | | | | | | | | | | | | | descriptor, as used for the tp_methods slot of a type. These new flag bits are both optional, and mutually exclusive. Most methods will not use either. These flags are used to create special method types which exist in the same namespace as normal methods without having to use tedious construction code to insert the new special method objects in the type's tp_dict after PyType_Ready() has been called. If METH_CLASS is specified, the method will represent a class method like that returned by the classmethod() built-in. If METH_STATIC is specified, the method will represent a static method like that returned by the staticmethod() built-in. These flags may not be used in the PyMethodDef table for modules since these special method types are not meaningful in that case; a ValueError will be raised if these flags are found in that context.
* Change sys_exit to use METH_VARARGS.Neal Norwitz2002-03-271-2/+5
| | | | sys.exit() now requires 0-1 arguments. Previously 2+ arguments were allowed.
* I've been waiting 8 years for KSR to re-emerge from bankruptcy. If theyTim Peters2002-03-251-4/+0
| | | | ever do, they can damn well #define _POSIX_THREADS their own damn selves.
* SF bug 480215: softspace confused in nested printTim Peters2002-03-241-10/+12
| | | | | | | | | | This fixes the symptom, but PRINT_ITEM has no way to know what (if anything) PyFile_WriteObject() writes unless the object being printed is a string. When the object isn't a string, this fix retains the guess that softspace should be set after PyFile_WriteObject(). We might want to say that it's the job of filelike-object write methods to leave the file's softspace in the correct state. That would probably be better -- but everyone relies on PRINT_ITEM to guess for them now.
* Fix wording of sys.exit docstring. Close SF bug 534113.Neil Schemenauer2002-03-231-1/+1
|
* Disable the parser hacks that enabled the "yield" keyword using a futureNeil Schemenauer2002-03-222-11/+15
| | | | statement.
* Re-enable GC of generator objects.Neil Schemenauer2002-03-181-6/+6
|
* Document that _POSIX_SEMAPHORES is predefined.Martin v. Löwis2002-03-171-0/+4
|
* Patch #525532: Add support for POSIX semaphores.Martin v. Löwis2002-03-171-0/+119
|