[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f0053d05ed6d by Serhiy Storchaka in branch '3.4':
Issue #24336: The contextmanager decorator now works with functions with
https://hg.python.org/cpython/rev/f0053d05ed6d

New changeset 20aa7083057e by Serhiy Storchaka in branch '3.5':
Issue #24336: The contextmanager decorator now works with functions with
https://hg.python.org/cpython/rev/20aa7083057e

New changeset d4e4bfabc21f by Serhiy Storchaka in branch 'default':
Issue #24336: The contextmanager decorator now works with functions with
https://hg.python.org/cpython/rev/d4e4bfabc21f

New changeset 85c78d4db242 by Serhiy Storchaka in branch '2.7':
Issue #24336: Backported test for contextmanager.  Patch by Martin Panter.
https://hg.python.org/cpython/rev/85c78d4db242

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-06-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Martin for your patch.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-06-27 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +yselivanov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-06-27 Thread Yury Selivanov

Yury Selivanov added the comment:

lgtm.. Serhiy, I think you should just commit it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-06-27 Thread Nick Coghlan

Nick Coghlan added the comment:

My apologies Serhiy, I forgot this was directly assigned to me - all yours now!

--
assignee: ncoghlan - serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-06-01 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Martin Panter

Martin Panter added the comment:

Here is a patch with just the test case for 2.7, although I don’t have a strong 
opinion on whether it needs to be added or not.

--
Added file: http://bugs.python.org/file39577/context-kw-2.7.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy: +ethan.furman

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Martin Panter

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 rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Martin Panter

Martin Panter added the comment:

Sorry here’s a better version that adapts some monkey-patching in the test 
suite (test_with).

--
Added file: http://bugs.python.org/file39572/context-kw.v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
components: +Library (Lib)
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Martin Panter

Martin Panter added the comment:

But maybe it wouldn’t hurt adding the test case in test_contextlib to Python 2.

--
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - ncoghlan
nosy: +ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Martin Panter

Martin Panter added the comment:

New version with simpler test; thanks Serhiy.

Looking closer at the history, this actually seems to be a regression caused by 
revision e4ba097123f6 (Issue 11647). Python 2 is not affected.

--
Added file: http://bugs.python.org/file39574/context-kw.v3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Nick Coghlan

Nick Coghlan added the comment:

The v3 patch looks good to me, and indeed it's a regression I introduced back 
in 3.2.

I don't see much value in adding the test to the 2.7 test suite (with 
contextlib2 just a pip install away, it's very unlikely the standard library 
version will see any significant updates)

--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24336] Allow arbitrary keywords to @contextmanager functions

2015-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. The patch isn't applied cleanly to 2.7. If you Martin will provide the 
patch with tests for 2.7, I don't see why not apply it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24336
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com