[issue24336] Allow arbitrary keywords to @contextmanager functions
Martin Panter
report at bugs.python.org
Sun May 31 09:55:38 CEST 2015
New submission from Martin Panter:
This patch allows many context managers to accept keyword arguments called “func” and “self”. Current behaviour:
>>> with TestCase().subTest(func="blaua"): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/contextlib.py", line 126, in helper
return _GeneratorContextManager(func, *args, **kwds)
TypeError: __init__() got multiple values for argument 'func'
----------
files: context-kw.patch
keywords: patch
messages: 244523
nosy: vadmium
priority: normal
severity: normal
stage: patch review
status: open
title: Allow arbitrary keywords to @contextmanager functions
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39571/context-kw.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24336>
_______________________________________
More information about the Python-bugs-list
mailing list