summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-300/+300
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions ↵Georg Brandl2009-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70642,70648,70656,70661,70765,70773,70789,70824-70825,70828,70830,70832,70836,70838,70842,70851,70855,70857-70858 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70642 | georg.brandl | 2009-03-28 01:48:48 +0100 (Sa, 28 Mär 2009) | 1 line Fix typo. ........ r70648 | georg.brandl | 2009-03-28 20:10:37 +0100 (Sa, 28 Mär 2009) | 1 line #5324: document __subclasses__(). ........ r70656 | georg.brandl | 2009-03-28 20:33:33 +0100 (Sa, 28 Mär 2009) | 2 lines Add a script to fixup rst files if the pre-commit hook rejects them. ........ r70661 | georg.brandl | 2009-03-28 20:57:36 +0100 (Sa, 28 Mär 2009) | 2 lines Add section numbering to some of the larger subdocuments. ........ r70765 | georg.brandl | 2009-03-31 00:09:34 +0200 (Di, 31 Mär 2009) | 1 line #5199: make warning about vars() assignment more visible. ........ r70773 | georg.brandl | 2009-03-31 00:43:00 +0200 (Di, 31 Mär 2009) | 1 line #5039: make it clear that the impl. note refers to CPython. ........ r70789 | georg.brandl | 2009-03-31 03:25:15 +0200 (Di, 31 Mär 2009) | 1 line Fix a wrong struct field assignment (docstring as closure). ........ r70824 | georg.brandl | 2009-03-31 17:43:20 +0200 (Di, 31 Mär 2009) | 1 line #5519: remove reference to Kodos, which seems dead. ........ r70825 | georg.brandl | 2009-03-31 17:46:30 +0200 (Di, 31 Mär 2009) | 1 line #5566: fix versionadded from PyLong ssize_t functions. ........ r70828 | georg.brandl | 2009-03-31 17:50:16 +0200 (Di, 31 Mär 2009) | 1 line #5581: fget argument of abstractproperty is optional as well. ........ r70830 | georg.brandl | 2009-03-31 18:11:45 +0200 (Di, 31 Mär 2009) | 1 line #5529: backport new docs of import semantics written by Brett to 2.x. ........ r70832 | georg.brandl | 2009-03-31 18:31:11 +0200 (Di, 31 Mär 2009) | 1 line #1386675: specify WindowsError as the exception, because it has a winerror attribute that EnvironmentError doesnt have. ........ r70836 | georg.brandl | 2009-03-31 18:50:25 +0200 (Di, 31 Mär 2009) | 1 line #5417: replace references to undocumented functions by ones to documented functions. ........ r70838 | georg.brandl | 2009-03-31 18:54:38 +0200 (Di, 31 Mär 2009) | 1 line #992207: document that the parser only accepts \\n newlines. ........ r70842 | georg.brandl | 2009-03-31 19:13:06 +0200 (Di, 31 Mär 2009) | 1 line #970783: document PyObject_Generic[GS]etAttr. ........ r70851 | georg.brandl | 2009-03-31 20:26:55 +0200 (Di, 31 Mär 2009) | 1 line #837577: note cryptic return value of spawn*e on invalid env dicts. ........ r70855 | georg.brandl | 2009-03-31 20:30:37 +0200 (Di, 31 Mär 2009) | 1 line #5245: note that PyRun_SimpleString doesnt return on SystemExit. ........ r70857 | georg.brandl | 2009-03-31 20:33:10 +0200 (Di, 31 Mär 2009) | 1 line #5227: note that Py_Main doesnt return on SystemExit. ........ r70858 | georg.brandl | 2009-03-31 20:38:56 +0200 (Di, 31 Mär 2009) | 1 line #5241: document missing U in regex howto. ........
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-2/+2
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-2/+2
|
* Make generator repr consistent with function and code object repr.Georg Brandl2008-05-161-1/+1
|
* #2863: add gen.__name__ and add this name to generator repr().Georg Brandl2008-05-151-2/+32
|
* #1473257: add generator.gi_code attribute that refers toGeorg Brandl2008-01-261-0/+5
| | | | the original code object backing the generator. Patch by Collin Winter.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-1/+1
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Generators had their throw() method allowing string exceptions. That's aBrett Cannon2007-09-111-4/+1
| | | | | | | no-no. Fixes issue #1147. Need to fix 2.5 to raise a proper warning if a string exception is passed in.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-3/+2
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-1/+1
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* gen_del(): Looks like much this was copy/pasted fromTim Peters2006-04-151-1/+1
| | | | | | slot_tp_del(), but while the latter had to cater to types that don't participate in GC, we know that generators do. That allows strengthing an assert().
* - Whitespace normalizationThomas Wouters2006-04-151-12/+14
| | | | | | - In functions where we already hold the same object in differently typed pointers, use the correctly typed pointer instead of casting the other pointer a second time.
* Fix SF#1470508: crash in generator cycle finalization. There were twoPhillip J. Eby2006-04-151-10/+11
| | | | | | | | | | | problems: first, PyGen_NeedsFinalizing() had an off-by-one bug that prevented it from ever saying a generator didn't need finalizing, and second, frame objects cleared themselves in a way that caused their owning generator to think they were still executable, causing a double deallocation of objects on the value stack if there was still a loop on the block stack. This revision also removes some unnecessary close() operations from test_generators that are now appropriately handled by the cycle collector.
* Add a cast to make code compile with a C++ compiler.Anthony Baxter2006-04-131-1/+1
|
* Don't set gi_frame to Py_None, use NULL instead, eliminating some insanePhillip J. Eby2006-04-121-7/+7
| | | | pointer dereferences.
* wrap docstrings so they are less than 80 columns. add spaces after commas.Neal Norwitz2006-04-121-3/+5
|
* gen_throw(): The caller doesn't own PyArg_ParseTuple()Tim Peters2006-04-121-3/+1
| | | | | | "O" arguments, so must not decref them. This accounts for why running test_contextlib.test_main() in a loop eventually tried to deallocate Py_None.
* SF Patch #1463867: Improved generator finalization to allow generatorsPhillip J. Eby2006-04-101-0/+20
| | | | | | | | that are suspended outside of any try/except/finally blocks to be garbage collected even if they are part of a cycle. Generators that suspend inside of an active try/except or try/finally block (including those created by a ``with`` statement) are still not GC-able if they are part of a cycle, however.
* Support throw() of string exceptions.Phillip J. Eby2006-03-251-1/+4
|
* Change int to Py_ssize_t in several places.Martin v. Löwis2006-03-071-1/+1
| | | | | Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
* PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon2006-03-011-3/+3
| | | | | | | | | added message attribute compared to the previous version of Exception. It is also a new-style class, making all exceptions now new-style. KeyboardInterrupt and SystemExit inherit from BaseException directly. String exceptions now raise DeprecationWarning. Applies patch 1104669, and closes bugs 1012952 and 518846.
* * Refcount leak. It was just a reference to Py_None, but still.Armin Rigo2006-02-141-3/+9
| | | | | | | * Allow the 3rd argument to generator.throw() to be None. The 'raise' statement does the same, and anyway it follows the general policy that optional arguments of built-ins should, when reasonable, have a default value specifiable from Python.
* Fix a too-aggressive assert (see SF#1257960). Previously, gen_iternextPhillip J. Eby2005-08-131-1/+1
| | | | | | | | | was never called during interpreter shutdown GC, so the f_back!=NULL assertion was correct. Now that generators get close()d during GC, the assertion was being triggered because the generator close() was being called as the top-level frame. However, nothing actually is broken by this; it's just that the condition was unexpected in previous Python versions.
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-021-5/+234
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* SF patch #1020188: Use Py_CLEAR where necessary to avoid crashesRaymond Hettinger2004-09-011-2/+1
| | | | (Contributed by Dima Dorfman)
* Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis2004-06-271-1/+1
|
* * Factor out PyObject_SelfIter().Raymond Hettinger2004-06-121-9/+3
| | | | * Change a XDECREF to DECREF (adding an assertion just to be sure).
* Patch #957398: Add public API for Generator Object/Type.Martin v. Löwis2004-06-011-0/+129