[issue24606] segfault caused by nested calls to map()

2015-07-10 Thread David Lukeš
New submission from David Lukeš: The following program makes Python 3.4.3 crash with a segmentation fault: ``` #!/usr/bin/env python3 import operator N = 50 l = [0] for i in range(N): l = map(operator.add, l, [1]) print(list(l)) ``` I suppose the problem is that there are too many

[issue32306] Clarify map API in concurrent.futures

2017-12-13 Thread David Lukeš
New submission from David Lukeš <dafydd.lu...@gmail.com>: The docstring for `concurrent.futures.Executor.map` starts by stating that it is "Equivalent to map(func, *iterables)". In the case of Python 3, I would argue this is true only superficially: with `map`, the user

[issue32306] Clarify map API in concurrent.futures

2017-12-20 Thread David Lukeš
David Lukeš <dafydd.lu...@gmail.com> added the comment: Hi Antoine, Thanks for the response! :) I think the problem lies in the line immediately preceding the code you've posted: ``` fs = [self.submit(fn, *args) for args in zip(*iterables)] ``` In other words, all the jobs are

[issue32306] Clarify map API in concurrent.futures

2017-12-20 Thread David Lukeš
David Lukeš <dafydd.lu...@gmail.com> added the comment: Yes, sorry for not being quite clear the first time around :) I eventually found out about Pool.imap (see item 3 on list in OP) and indeed it fits my use case very nicely, but my point was that the documentation is somewhat misl

[issue32306] Clarify map API in concurrent.futures

2017-12-21 Thread David Lukeš
David Lukeš <dafydd.lu...@gmail.com> added the comment: Perfect, thanks! -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33068] Inconsistencies in parsing (evaluating?) longstrings

2018-03-13 Thread David Lukeš
New submission from David Lukeš <dafydd.lu...@gmail.com>: """ \""" """ evaluates to ' """ ' (as expected), but without the surrounding spaces, """\"""""" evaluates to '"' instea

[issue33068] Inconsistencies in parsing (evaluating?) longstrings

2018-03-13 Thread David Lukeš
David Lukeš <dafydd.lu...@gmail.com> added the comment: Oh, right, of course! Sorry and thanks for taking the time to clarify that :) -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue29842] Make Executor.map work with infinite/large inputs correctly

2021-01-14 Thread David Lukeš
David Lukeš added the comment: Any updates on this? Making Executor.map lazier would indeed be more consistent and very useful, it would be a shame if the PR went to waste :) It's a feature I keep wishing for in comparison with the older and process-only multiprocessing API. And eventually

[issue43604] Fix tempfile.mktemp()

2021-03-23 Thread David Lukeš
David Lukeš added the comment: > A secure `mktemp` could be as simple as ... Though in practice, I'd rather be inclined to make the change in `tempfile._RandomNameSequence`, so as to get the same behavior across the entire module, instead of special-casing `mktemp`. As Guido van Ros

[issue43604] Fix tempfile.mktemp()

2021-03-23 Thread David Lukeš
New submission from David Lukeš : I recently came across a non-testing use case for `tempfile.mktemp()` where I struggle to find a viable alternative -- temporary named pipes (FIFOs): ``` import os import tempfile import subprocess as sp fifo_path = tempfile.mktemp() os.mkfifo(fifo_path

[issue43604] Fix tempfile.mktemp()

2021-03-23 Thread David Lukeš
David Lukeš added the comment: > You can use TemporaryDirectory. That was actually the first approach I tried :) I even thought this could be used to make `mktemp` safe -- just create the name in a `TemporaryDirectory`. However, after reading through the mailing list thread, I reali

[issue43923] Can't create generic NamedTuple as of py3.9

2021-11-10 Thread David Lukeš
David Lukeš added the comment: This is unfortunate, especially since it used to work... Going forward, is the intention not to support this use case? Or is it possible that support for generic NamedTuples will be re-added in the future? -- nosy: +dlukes