mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
evaluate lambda keyword-only defaults after positional defaults (#16967 again)
This commit is contained in:
parent
8b466c9932
commit
419d9a83d5
4 changed files with 9 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue