[Python-checkins] CVS: python/dist/src/Lib/test test_generators.py,1.17.2.1,1.17.2.2

Tim Peters tim_one@users.sourceforge.net
Sat, 07 Jul 2001 21:30:31 -0700


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

Modified Files:
      Tag: descr-branch
	test_generators.py 
Log Message:
test_generators.py
    Passes again.
ceval.c
    Redid genobject type object to use PyObject_GenericGetAttr; got
    rid of genobject's custom getattr routine.
typeobject.c
    Improved the docstring wrapperbase tab_next uses for .next().
PLAN.txt
    Added note about major (IMO) lost dir() functionality (one of the
    reasons test_generators.py failed is that dir(object) usually
    returns an empty list now).


Index: test_generators.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v
retrieving revision 1.17.2.1
retrieving revision 1.17.2.2
diff -C2 -r1.17.2.1 -r1.17.2.2
*** test_generators.py	2001/07/07 22:55:28	1.17.2.1
--- test_generators.py	2001/07/08 04:30:29	1.17.2.2
***************
*** 381,388 ****
  >>> type(i)
  <type 'generator'>
  >>> dir(i)
  ['gi_frame', 'gi_running', 'next']
  >>> print i.next.__doc__
! next() -- get the next value, or raise StopIteration
  >>> iter(i) is i
  1
--- 381,394 ----
  >>> type(i)
  <type 'generator'>
+ 
+ XXX dir(object) *generally* doesn't return useful stuff in descr-branch.
  >>> dir(i)
+ []
+ 
+ Was hoping to see this instead:
  ['gi_frame', 'gi_running', 'next']
+ 
  >>> print i.next.__doc__
! x.next() -> get the next value, or raise StopIteration
  >>> iter(i) is i
  1
***************
*** 400,404 ****
  Traceback (most recent call last):
    ...
! TypeError: object has read-only attributes
  >>> def g():
  ...     yield me.gi_running
--- 406,410 ----
  Traceback (most recent call last):
    ...
! TypeError: readonly attribute
  >>> def g():
  ...     yield me.gi_running