[Python-ideas] itertools.compress default selectors

2021-09-13 Thread ml
Hi! I propose to enhance "itertools.compress" in such a way so if you don't provide selectors, then "data" itself is used as a selectors. So "compress(a)" would be equivalent to "compress(a, a)" For example: >>> from itertools import compress >>> [*compress([0, 1, 2, 3]))] [1, 2, 3] >>>

[Python-ideas] Re: itertools.compress default selectors

2021-09-22 Thread ml
Then may be we could enhance "filter" or introduce some alias? Why we have "filterfalse" and don't have "filtertrue"?Thanks!Stepan Dyatkovskiy 14.09.2021, 22:20, "Chris Angelico" :On Wed, Sep 15, 2021 at 4:58 AM Tim Peters wrote: Or perhaps the `compress()` implementation cou

[Python-ideas] Re: Fill in missing contextvars/asyncio task support

2021-06-23 Thread yselivanov . ml
On Tue, Jun 22 2021 at 04:40:45 AM -, Mark Gordon wrote: Yury Selivanov wrote: On Mon, Jun 21, 2021 at 7:20 PM Mark Gordon msg...@gmail.com wrote: > Yeah, it would indeed inherit the copy. We could, theoretically, make > asyncio.Task accept context objects a

[Python-ideas] Re: Fill in missing contextvars/asyncio task support

2021-06-23 Thread yselivanov . ml
On Wed, Jun 23 2021 at 05:16:00 PM -, Mark Gordon wrote: That's a feature :) Perhaps we should add an example to the docs. What do you view as the point of the copy semantics, then? Are you asking why the context is using immutable data-structures internally, in the first place? Ple