0
0
mirror of https://github.com/python/cpython.git synced 2024-12-01 11:15:56 +01:00
cpython/Objects
Tim Peters 1fc240e851 Generalize dictionary() to accept a sequence of 2-sequences. At the
outer level, the iterator protocol is used for memory-efficiency (the
outer sequence may be very large if fully materialized); at the inner
level, PySequence_Fast() is used for time-efficiency (these should
always be sequences of length 2).

dictobject.c, new functions PyDict_{Merge,Update}FromSeq2.  These are
wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2-
sequences argument instead of a mapping object.  For now, I left these
functions file static, so no corresponding doc changes.  It's tempting
to change dict.update() to allow a sequence-of-2-seqs argument too.

Also changed the name of dictionary's keyword argument from "mapping"
to "x".  Got a better name?  "mapping_or_sequence_of_pairs" isn't
attractive, although more so than "mosop" <wink>.

abstract.h, abstract.tex:  Added new PySequence_Fast_GET_SIZE function,
much faster than going thru the all-purpose PySequence_Size.

libfuncs.tex:
- Document dictionary().
- Fiddle tuple() and list() to admit that their argument is optional.
- The long-winded repetitions of "a sequence, a container that supports
  iteration, or an iterator object" is getting to be a PITA.  Many
  months ago I suggested factoring this out into "iterable object",
  where the definition of that could include being explicit about
  generators too (as is, I'm not sure a reader outside of PythonLabs
  could guess that "an iterator object" includes a generator call).
- Please check my curly braces -- I'm going blind <0.9 wink>.

abstract.c, PySequence_Tuple():  When PyObject_GetIter() fails, leave
its error msg alone now (the msg it produces has improved since
PySequence_Tuple was generalized to accept iterable objects, and
PySequence_Tuple was also stomping on the msg in cases it shouldn't
have even before PyObject_GetIter grew a better msg).
2001-10-26 05:06:50 +00:00
..
.cvsignore
abstract.c Generalize dictionary() to accept a sequence of 2-sequences. At the 2001-10-26 05:06:50 +00:00
bufferobject.c Fix for Bug #216405: 2001-10-19 13:49:35 +00:00
cellobject.c Use new GC API. 2001-08-29 23:54:21 +00:00
classobject.c Fix for SF bug #472940: can't getattr() attribute shown by dir() 2001-10-22 02:00:09 +00:00
cobject.c
complexobject.c complex_subtype_from_string(): move the declaration of s_buffer[] out 2001-10-25 18:07:22 +00:00
descrobject.c Methods of built-in types now properly check for keyword arguments 2001-10-22 00:43:43 +00:00
dictobject.c Generalize dictionary() to accept a sequence of 2-sequences. At the 2001-10-26 05:06:50 +00:00
fileobject.c SF patch #474175 (Jay T Miller): file.readinto arg parsing bug 2001-10-23 21:25:24 +00:00
floatobject.c SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00
frameobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
funcobject.c Enable GC for new-style instances. This touches lots of files, since 2001-10-05 20:51:39 +00:00
intobject.c Add additional coercion support for "self subtypes" to int, long, 2001-09-19 01:25:16 +00:00
iterobject.c Patch #427190: Implement and use METH_NOARGS and METH_O. 2001-08-16 13:15:00 +00:00
listobject.c Enable GC for new-style instances. This touches lots of files, since 2001-10-05 20:51:39 +00:00
longobject.c Enable GC for new-style instances. This touches lots of files, since 2001-10-05 20:51:39 +00:00
methodobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
moduleobject.c Add missing "static" declarations (found by "make smelly"). 2001-10-21 22:28:58 +00:00
object.c cleanup indentation 2001-10-22 16:30:36 +00:00
obmalloc.c
rangeobject.c repr's converted to using PyString_FromFormat() instead of sprintf'ing 2001-08-24 18:34:26 +00:00
sliceobject.c Add optional docstrings to member descriptors. For backwards 2001-09-20 20:46:19 +00:00
stringobject.c Make the error message for unsupported operand types cleaner, in 2001-10-22 04:12:44 +00:00
structseq.c Missing file structseq.c for SF patch #462296 2001-10-18 20:47:51 +00:00
tupleobject.c Enable GC for new-style instances. This touches lots of files, since 2001-10-05 20:51:39 +00:00
typeobject.c Allow assignment to newinstance.__dict__. 2001-10-26 04:26:12 +00:00
unicodectype.c
unicodeobject.c Additional test and documentation for the unicode() changes. 2001-10-19 12:02:29 +00:00
unicodetype_db.h
weakrefobject.c Referencable is not a word, so don't use it in an error message <wink>. 2001-10-22 16:31:40 +00:00
xxobject.c