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/", 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:

Python tracker <>
Python-bugs-list mailing list

Reply via email to