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

Guido van Rossum gvanrossum@users.sourceforge.net
2001年10月21日 17:43:45 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv21240/Lib/test
Modified Files:
	test_descr.py 
Log Message:
Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored). The only built-in methods
that take keyword arguments are __call__, __init__ and __new__.
Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** test_descr.py	2001年10月18日 15:49:21	1.91
--- test_descr.py	2001年10月22日 00:43:43	1.92
***************
*** 2341,2344 ****
--- 2341,2352 ----
 capture.close()
 
+ def kwdargs():
+ if verbose: print "Testing keyword arguments to __init__, __call__..."
+ def f(a): return a
+ vereq(f.__call__(a=42), 42)
+ a = []
+ list.__init__(a, sequence=[0, 1, 2])
+ vereq(a, [0, 1, 2]) 
+ 
 def test_main():
 class_docstrings()
***************
*** 2390,2393 ****
--- 2398,2402 ----
 buffer_inherit()
 str_of_str_subclass()
+ kwdargs()
 if verbose: print "All OK"
 

AltStyle によって変換されたページ (->オリジナル) /