evaluate lambda keyword-only defaults after positional defaults (#16967 again)

This commit is contained in:
Benjamin Peterson 2013-02-10 09:48:22 -05:00
parent 8b466c9932
commit 419d9a83d5
4 changed files with 9 additions and 5 deletions

View file

@ -183,6 +183,10 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
def f(v=a, x=b, *, y=c, z=d):
pass
self.assertEqual(str(err.exception), "global name 'b' is not defined")
with self.assertRaises(NameError) as err:
f = lambda v=a, x=b, *, y=c, z=d: None
self.assertEqual(str(err.exception), "global name 'b' is not defined")
def test_main():
run_unittest(KeywordOnlyArgTestCase)