]> granicus.if.org Git - python/commitdiff
Merged revisions 78515-78516,78522 via svnmerge from
authorEzio Melotti <ezio.melotti@gmail.com>
Mon, 1 Mar 2010 04:05:56 +0000 (04:05 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Mon, 1 Mar 2010 04:05:56 +0000 (04:05 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78515 | georg.brandl | 2010-02-28 20:19:17 +0200 (Sun, 28 Feb 2010) | 1 line

  #8030: make builtin type docstrings more consistent: use "iterable" instead of "seq(uence)", use "new" to show that set() always returns a new object.
........
  r78516 | georg.brandl | 2010-02-28 20:26:37 +0200 (Sun, 28 Feb 2010) | 1 line

  The set types can also be called without arguments.
........
  r78522 | ezio.melotti | 2010-03-01 01:59:00 +0200 (Mon, 01 Mar 2010) | 1 line

  #8030: more docstring fix for builtin types.
........

Objects/dictobject.c
Objects/listobject.c
Objects/setobject.c
Objects/tupleobject.c

index f4d86835e9558f0ec3b9e973189d3109bd4d5e0e..5cf9ad1c05a1ee2c9048759f0f4a22f4d43e4731 100644 (file)
@@ -2222,12 +2222,12 @@ dict_iter(PyDictObject *dict)
 }
 
 PyDoc_STRVAR(dictionary_doc,
-"dict() -> new empty dictionary.\n"
+"dict() -> new empty dictionary\n"
 "dict(mapping) -> new dictionary initialized from a mapping object's\n"
-"    (key, value) pairs.\n"
-"dict(seq) -> new dictionary initialized as if via:\n"
+"    (key, value) pairs\n"
+"dict(iterable) -> new dictionary initialized as if via:\n"
 "    d = {}\n"
-"    for k, v in seq:\n"
+"    for k, v in iterable:\n"
 "        d[k] = v\n"
 "dict(**kwargs) -> new dictionary initialized with the name=value pairs\n"
 "    in the keyword argument list.  For example:  dict(one=1, two=2)");
index 9f35d9d06632647246d79c7ecfd03624d6f038bb..6188becbf1b32e2deef57969f466a06e945fb7ff 100644 (file)
@@ -2516,8 +2516,8 @@ static PySequenceMethods list_as_sequence = {
 };
 
 PyDoc_STRVAR(list_doc,
-"list() -> new list\n"
-"list(sequence) -> new list initialized from sequence's items");
+"list() -> new empty list\n"
+"list(iterable) -> new list initialized from iterable's items");
 
 
 static PyObject *
index 81fd31580e4ade5b3527785a6e93be75b436d51b..af5d576b98d16c8c7d35a92c5ebcd6ffd8927eac 100644 (file)
@@ -2102,7 +2102,8 @@ static PyNumberMethods set_as_number = {
 };
 
 PyDoc_STRVAR(set_doc,
-"set(iterable) --> set object\n\
+"set() -> new empty set object\n\
+set(iterable) -> new set object\n\
 \n\
 Build an unordered collection of unique elements.");
 
@@ -2200,7 +2201,8 @@ static PyNumberMethods frozenset_as_number = {
 };
 
 PyDoc_STRVAR(frozenset_doc,
-"frozenset(iterable) --> frozenset object\n\
+"frozenset() -> empty frozenset object\n\
+frozenset(iterable) -> frozenset object\n\
 \n\
 Build an immutable unordered collection of unique elements.");
 
index b1a7003cec443a1303eac66ecb6ac5f827073343..92fc1f489fe8ecfd7342e3199163c4ab8346a775 100644 (file)
@@ -630,10 +630,10 @@ tuple_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 }
 
 PyDoc_STRVAR(tuple_doc,
-"tuple() -> an empty tuple\n"
-"tuple(sequence) -> tuple initialized from sequence's items\n"
-"\n"
-"If the argument is a tuple, the return value is the same object.");
+"tuple() -> empty tuple\n\
+tuple(iterable) -> tuple initialized from iterable's items\n\
+\n\
+If the argument is a tuple, the return value is the same object.");
 
 static PySequenceMethods tuple_as_sequence = {
        (lenfunc)tuplelength,                   /* sq_length */