[Python-checkins] CVS: python/dist/src/Objects dictobject.c,2.115,2.116

Tim Peters tim_one@users.sourceforge.net
Sat, 27 Oct 2001 11:27:50 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv30140/python/Objects

Modified Files:
	dictobject.c 
Log Message:
dictionary() constructor:
+ Change keyword arg name from "x" to "items".  People passing a mapping
  object can stretch their imaginations <wink>.
+ Simplify the docstring text.


Index: dictobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v
retrieving revision 2.115
retrieving revision 2.116
diff -C2 -d -r2.115 -r2.116
*** dictobject.c	2001/10/26 05:06:50	2.115
--- dictobject.c	2001/10/27 18:27:48	2.116
***************
*** 1782,1786 ****
  {
  	PyObject *arg = NULL;
! 	static char *kwlist[] = {"x", 0};
  	int result = 0;
  
--- 1782,1786 ----
  {
  	PyObject *arg = NULL;
! 	static char *kwlist[] = {"items", 0};
  	int result = 0;
  
***************
*** 1808,1817 ****
  "dictionary(mapping) -> new dict initialized from a mapping object's\n"
  "    (key, value) pairs.\n"
! "dictionary(seq) -> new dict initialized from the 2-element elements of\n"
! "    a sequence; for example, from mapping.items().  seq must be an\n"
! "    iterable object, producing iterable objects each producing exactly\n"
! "    two objects, the first of which is used as a key and the second as\n"
! "    its value.  If a given key is seen more than once, the dict retains\n"
! "    the last value associated with it.";
  
  PyTypeObject PyDict_Type = {
--- 1808,1815 ----
  "dictionary(mapping) -> new dict initialized from a mapping object's\n"
  "    (key, value) pairs.\n"
! "dictionary(seq) -> new dict initialized as if via:\n"
! "    d = {}\n"
! "    for k, v in seq:\n"
! "        d[k] = v";
  
  PyTypeObject PyDict_Type = {