Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 2a9b0a93091b9ef7350a94bb3d3f1c43725b7a8c authored by Georg Brandl on 05 March 2011, 13:54:19 UTC
Close 2.0 branch.
Tip revision: 2a9b0a9
test_compile.py
from test_support import verbose, TestFailed

if verbose:
    print 'Running test on duplicate arguments'

try:
    exec('def f(a, a): pass')
    raise TestFailed, "duplicate arguments"
except SyntaxError:
    pass

try:
    exec('def f(a = 0, a = 1): pass')
    raise TestFailed, "duplicate keyword arguments"
except SyntaxError:
    pass
back to top