[Python-checkins] CVS: python/dist/src/Lib/test test_weakref.py,1.3,1.3.2.1

Guido van Rossum gvanrossum@usw-pr-cvs1.sourceforge.net
Tue, 13 Mar 2001 02:07:44 -0800


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

Modified Files:
      Tag: iter-branch
	test_weakref.py 
Log Message:
This is the first iteration of my iterator patches.  Don't worry, this
is on a branch (iter-branch), and it may still change.

Caveats:

- It's incomplete: class instances don't support __iter__ yet.

- It's currently using call notation to get the next item from the
  iterator; there have been arguments for making this use the next()
  method.

- The iter() built-in function is overloaded: iter(x) returns the
  iterator from x, iter(func, value) returns an iterator that calls a
  function until it returns or raises value.  Note: the 'raises' part
  is experimental.

- There is no test suite or documentation yet.

Enjoy!



Index: test_weakref.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -r1.3 -r1.3.2.1
*** test_weakref.py	2001/03/01 03:06:53	1.3
--- test_weakref.py	2001/03/13 10:07:42	1.3.2.1
***************
*** 181,184 ****
--- 181,185 ----
  del items1, items2
  del objects, o
+ print dict.items()
  verify(len(dict)==0, "deleting the keys did not clear the dictionary")
  print "weak key dict test complete"