New submission from Paul Pogonyshev:
Attached scripts fails with 'NameError: free variable 'a' referenced
before assignment in enclosing scope'. If you remove '*' in function
parameter list, it works. I think it is a bug.
----------
components: Interpreter Core
files: test.py
messages: 57277
nosy: _doublep
severity: normal
status: open
title: new keyword-only function parameters interact badly with nested functions
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8716/test.py
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1409>
__________________________________
# Note that '*,' here is important.
def foo(*, a=None):
def bar(dictionary):
dictionary['a'] = a
return dictionary
return bar
print(foo(a=42)({ }))
print(foo()({ }))
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com