home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / TEST_COMPILE.PY < prev    next >
Encoding:
Python Source  |  2000-09-28  |  356 b   |  17 lines

  1. from test_support import verbose, TestFailed
  2.  
  3. if verbose:
  4.     print 'Running test on duplicate arguments'
  5.  
  6. try:
  7.     exec('def f(a, a): pass')
  8.     raise TestFailed, "duplicate arguments"
  9. except SyntaxError:
  10.     pass
  11.  
  12. try:
  13.     exec('def f(a = 0, a = 1): pass')
  14.     raise TestFailed, "duplicate keyword arguments"
  15. except SyntaxError:
  16.     pass
  17.