[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

2016-11-19 Thread Martin Blais
Martin Blais added the comment: Well that just echoes exactly what I originally thought, but somebody else said it was not needed because ExitStack already exists and could be used for that purpose. If this were at work and/or it were all just to me, I'd just implement a brand

[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

2016-11-18 Thread Martin Blais
Martin Blais added the comment: Adding nullcontext = ExitStack in the source file would solve this problem in a single line of code. -- nosy: +blais ___ Python tracker <http://bugs.python.org/issue10

[issue10049] Add a "no-op" (null) context manager to contextlib

2016-11-18 Thread Martin Blais
Martin Blais added the comment: I've been looking for this today; I would have used it. Instead of an obvious (and explicit) null context manager, I had to read through this entire thread to eventually find out that I can use something called ExitStack(), which is designed for anothe

[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2016-08-06 Thread Martin Blais
Martin Blais added the comment: Thank you Martin! -- ___ Python tracker <http://bugs.python.org/issue24278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2015-06-07 Thread Martin Blais
Martin Blais added the comment: LGTM! Thanks for making the change. -- ___ Python tracker <http://bugs.python.org/issue24278> ___ ___ Python-bugs-list mailin

[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2015-05-25 Thread Martin Blais
Martin Blais added the comment: Oh, and yes, just adding this info at the top would be fine IMO. It shouldn't have to be repeated. -- ___ Python tracker <http://bugs.python.org/is

[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2015-05-25 Thread Martin Blais
Martin Blais added the comment: Adding information that tells developers where the memory for those returned areas is stored and as you mention, its lifetime guarantees w.r.t. to the Python object, would go a long way towards making this more clear. The questions that immediately came to my

[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2015-05-24 Thread Martin Blais
Martin Blais added the comment: I don't think I'm the right person to propose a patch for this; I'm just guessing how it works so far, I haven't had time to look into the source code in detail, I'm sure there&#

[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2015-05-24 Thread Martin Blais
New submission from Martin Blais: Functions that parse arguments like PyArg_ParseTupleAndKeywords() have several formatters that fill in C strings, e.g. "s". In the C API doc: https://docs.python.org/3.5/c-api/arg.html#c.PyArg_ParseTupleAndKeywords There should be an explicit

[issue5631] Distutils "upload" command does not show up in --help-commands output.

2009-03-31 Thread Martin Blais
New submission from Martin Blais : The output of running "python setup.py --help-commands" does not include the "upload" command. -- components: Library (Lib) messages: 84884 nosy: blais severity: normal status: open title: Distutils "upload" command does

[issue5206] with context object for unittest assertRaises()

2009-02-10 Thread Martin Blais
Changes by Martin Blais : -- components: +Library (Lib) type: -> feature request ___ Python tracker <http://bugs.python.org/issue5206> ___ ___ Python-bugs-lis

[issue5206] with context object for unittest assertRaises()

2009-02-10 Thread Martin Blais
New submission from Martin Blais : Here is a useful trick to restore the normal call syntax for delayed evaluation for assertRaises(): from contextlib import contextmanager @contextmanager def raised(exctype): try: yield raise AssertionError