0
0
mirror of https://github.com/python/cpython.git synced 2024-11-30 18:51:15 +01:00
cpython/Include
Tim Peters 6912d4ddf0 Generalize tuple() to work nicely with iterators.
NEEDS DOC CHANGES.
This one surprised me!  While I expected tuple() to be a no-brainer, turns
out it's actually dripping with consequences:
1. It will *allow* the popular PySequence_Fast() to work with any iterable
   object (code for that not yet checked in, but should be trivial).
2. It caused two std tests to fail.  This because some places used
   PyTuple_Sequence() (the C spelling of tuple()) as an indirect way to test
   whether something *is* a sequence.  But tuple() code only looked for the
   existence of sq->item to determine that, and e.g. an instance passed
   that test whether or not it supported the other operations tuple()
   needed (e.g., __len__).  So some things the tests *expected* to fail
   with an AttributeError now fail with a TypeError instead.  This looks
   like an improvement to me; e.g., test_coercion used to produce 559
   TypeErrors and 2 AttributeErrors, and now they're all TypeErrors.  The
   error details are more informative too, because the places calling this
   were *looking* for TypeErrors in order to replace the generic tuple()
   "not a sequence" msg with their own more specific text, and
   AttributeErrors snuck by that.
2001-05-05 03:56:37 +00:00
..
abstract.h Generalize tuple() to work nicely with iterators. 2001-05-05 03:56:37 +00:00
bitset.h
bufferobject.h
cellobject.h PEP 227 implementation 2001-01-25 20:04:14 +00:00
ceval.h If a code object is compiled with nested scopes, define the CO_NESTED flag. 2001-03-22 02:32:48 +00:00
classobject.h Add the necessary field for weak reference support to the function and 2001-03-23 04:17:58 +00:00
cobject.h
codecs.h
compile.h If a code object is compiled with nested scopes, define the CO_NESTED flag. 2001-03-22 02:32:48 +00:00
complexobject.h
config.h
cStringIO.h
dictobject.h
errcode.h
eval.h
fileobject.h
floatobject.h
frameobject.h Variety of small INC/DECREF patches that fix reported memory leaks 2001-03-13 01:58:22 +00:00
funcobject.h Add the necessary field for weak reference support to the function and 2001-03-23 04:17:58 +00:00
graminit.h
grammar.h
import.h
intobject.h
intrcheck.h
iterobject.h Mondo changes to the iterator stuff, without changing how Python code 2001-04-23 14:08:49 +00:00
listobject.h
longintrepr.h
longobject.h Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
marshal.h It's unclear whether PyMarshal_XXX() are part of the public or private API. 2001-01-28 00:27:39 +00:00
metagrammar.h
methodobject.h
modsupport.h The addition of new parameters to functions in the Python/C API requires 2001-01-25 22:13:34 +00:00
moduleobject.h
node.h
object.h Mondo changes to the iterator stuff, without changing how Python code 2001-04-23 14:08:49 +00:00
objimpl.h A small change to the C API for weakly-referencable types: Such types 2001-03-22 18:26:47 +00:00
opcode.h Iterators phase 1. This comprises: 2001-04-20 19:13:02 +00:00
osdefs.h RISCOS patch by dschwertberger 2001-03-02 06:10:17 +00:00
parsetok.h
patchlevel.h Change the version to 2.2a0. This may look strange, but indicates 2001-04-18 04:31:01 +00:00
pgenheaders.h
py_curses.h Added header file for C API exported by _cursesmodule.c 2000-12-22 21:51:10 +00:00
pydebug.h
pyerrors.h Iterators phase 1. This comprises: 2001-04-20 19:13:02 +00:00
pyfpe.h
pygetopt.h Move our own getopt() implementation to _PyOS_GetOpt(), and use it 2000-11-03 08:18:37 +00:00
pymem.h
pyport.h Remove include-file-dependant half-prototype of clnt_create(). 2001-01-22 16:50:11 +00:00
pystate.h Add a new API, PyThreadState_DeleteCurrent() that combines 2001-01-23 01:46:06 +00:00
Python.h Iterators phase 1. This comprises: 2001-04-20 19:13:02 +00:00
pythonrun.h Add sys.excepthook. 2001-03-23 02:46:52 +00:00
pythread.h
rangeobject.h
rename1.h
sliceobject.h
stringobject.h _Py_ReleaseInternedStrings(): Private API function to decref and 2001-02-23 16:40:48 +00:00
structmember.h
symtable.h Set the line number correctly for a nested function with an exec or 2001-03-22 03:57:58 +00:00
sysmodule.h Add declarations for PySys_ResetWarnOptions() and 2000-12-15 22:01:39 +00:00
token.h
traceback.h
tupleobject.h
ucnhash.h refactored the unicodeobject/ucnhash interface, to hide the 2001-01-19 09:45:02 +00:00
unicodeobject.h This patch originated from an idea by Martin v. Loewis who submitted a 2001-04-23 14:44:21 +00:00