[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.96,1.97

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


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

Modified Files:
	test_descr.py 
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: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -d -r1.96 -r1.97
*** test_descr.py	2001/10/26 20:57:38	1.96
--- test_descr.py	2001/10/27 18:27:47	1.97
***************
*** 179,188 ****
      d = dictionary({})
      vereq(d, {})
!     d = dictionary(x={})
      vereq(d, {})
      d = dictionary({1: 2, 'a': 'b'})
      vereq(d, {1: 2, 'a': 'b'})
      vereq(d, dictionary(d.items()))
!     vereq(d, dictionary(x=d.iteritems()))
      for badarg in 0, 0L, 0j, "0", [0], (0,):
          try:
--- 179,188 ----
      d = dictionary({})
      vereq(d, {})
!     d = dictionary(items={})
      vereq(d, {})
      d = dictionary({1: 2, 'a': 'b'})
      vereq(d, {1: 2, 'a': 'b'})
      vereq(d, dictionary(d.items()))
!     vereq(d, dictionary(items=d.iteritems()))
      for badarg in 0, 0L, 0j, "0", [0], (0,):
          try:
***************
*** 227,231 ****
      Mapping.keys = lambda self: self.dict.keys()
      Mapping.__getitem__ = lambda self, i: self.dict[i]
!     d = dictionary(x=Mapping())
      vereq(d, Mapping.dict)
  
--- 227,231 ----
      Mapping.keys = lambda self: self.dict.keys()
      Mapping.__getitem__ = lambda self, i: self.dict[i]
!     d = dictionary(items=Mapping())
      vereq(d, Mapping.dict)
  
***************
*** 1866,1870 ****
      vereq(tuple(sequence=range(3)), (0, 1, 2))
      vereq(list(sequence=(0, 1, 2)), range(3))
!     vereq(dictionary(x={1: 2}), {1: 2})
  
      for constructor in (int, float, long, complex, str, unicode,
--- 1866,1870 ----
      vereq(tuple(sequence=range(3)), (0, 1, 2))
      vereq(list(sequence=(0, 1, 2)), range(3))
!     vereq(dictionary(items={1: 2}), {1: 2})
  
      for constructor in (int, float, long, complex, str, unicode,