[issue38559] async generators aclose() behavior in 3.8

2019-10-22 Thread Yury Selivanov
Yury Selivanov added the comment: Just discussed this issue off-list with Nathaniel. Maybe this isn't as severe as I thought it is. If we cancel all asyncio tasks before calling `loop.shutdown_asyncgens()` this *probably* becomes a non-issue. And "asyncio.run()" does just that

[issue38559] async generators aclose() behavior in 3.8

2019-10-22 Thread Yury Selivanov
New submission from Yury Selivanov : I believe I might have discovered a problem with asynchronous generators in 3.8. # Prelude In Python prior to 3.8 it was possible to overlap running of "asend()" and "athrow()" methods for the same asynchronous generato

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2019-10-21 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker <https://bugs.python.org/issue32856> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38423] Event loop implementation docs advertise set_event_loop which doesn't work with asyncio.run

2019-10-09 Thread Yury Selivanov
Yury Selivanov added the comment: Yes, docs updates sound good. -- ___ Python tracker <https://bugs.python.org/issue38423> ___ ___ Python-bugs-list mailin

[issue36356] Failure to build with address sanitizer

2019-10-08 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker <https://bugs.python.org/issue36356> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2019-10-08 Thread Yury Selivanov
Yury Selivanov added the comment: > In bpo-38392, I modified PyObject_GC_Track() in debug mode to detect this bug. Awesome!!! -- ___ Python tracker <https://bugs.python.org/issu

[issue36356] Failure to build with address sanitizer

2019-10-07 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 321def805abc5b7c92c7e90ca90cb2434fdab855 by Yury Selivanov (Ben Harper) in branch 'master': bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598) https://github.com/python/cpython/commit/321def805abc5b7c92c7e90ca90cb2434fdab855

[issue34344] Fix the docstring for AbstractEventLoopPolicy.get_event_loop

2019-10-03 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset b23a8423a923077e4f83d3f328bb7542b4c940ed by Yury Selivanov (idomic) in branch 'master': bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463) https://github.com/python/cpython/commit/b23a8423a923077e4f83d3f328bb7542b4c940ed

[issue38248] inconsistency in asyncio.Task between cancellation while running vs. cancellation immediately after it finishes

2019-10-01 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37146] opcode cache for LOAD_GLOBAL emits false alarm in memory leak hunting

2019-10-01 Thread Yury Selivanov
Yury Selivanov added the comment: > It seems like nobody came up with a solution for the debug mode since June. I > close the issue. Reopen it if you would like to propose a solution. I think the only solution is to have a flag to disable optimizations, inlcluding th

[issue30773] async generator receives wrong value when shared between coroutines

2019-09-30 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue30773] async generator receives wrong value when shared between coroutines

2019-09-30 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 2f87a7dc5a1ad7f37787f0adee242c931643f878 by Yury Selivanov (Miss Islington (bot)) in branch '3.8': bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (GH-7468) (#16486) https://github.com/python/cpython/commit

[issue30773] async generator receives wrong value when shared between coroutines

2019-09-30 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset fc4a044a3c54ce21e9ed150f7d769fb479d34c49 by Yury Selivanov in branch 'master': bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (#7468) https://github.com/python/cpython/commit

[issue38242] Revert the new asyncio Streams API

2019-09-29 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 1c19d656a79a00f58361ceb61c0a6d1faf90c686 by Yury Selivanov in branch '3.8': bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) (#16485) https://github.com/python/cpython/commit/1c19d656a79a00f58361ceb61c0a6d

[issue38242] Revert the new asyncio Streams API

2019-09-29 Thread Yury Selivanov
Yury Selivanov added the comment: I've reverted the code. Andrew, would really appreciate if you could quickly do a post commit review. -- stage: patch review -> commit review ___ Python tracker <https://bugs.python.org/issu

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-29 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 1c19d656a79a00f58361ceb61c0a6d1faf90c686 by Yury Selivanov in branch '3.8': bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) (#16485) https://github.com/python/cpython/commit/1c19d656a79a00f58361ceb61c0a6d

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-29 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +16071 pull_request: https://github.com/python/cpython/pull/16485 ___ Python tracker <https://bugs.python.org/issue36

[issue38242] Revert the new asyncio Streams API

2019-09-29 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +16070 pull_request: https://github.com/python/cpython/pull/16485 ___ Python tracker <https://bugs.python.org/issue38

[issue38242] Revert the new asyncio Streams API

2019-09-29 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 6758e6e12a71ef5530146161881f88df1fa43382 by Yury Selivanov in branch 'master': bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) https://github.com/python/cpython/commit/6758e6e12a71ef5530146161881f88

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-29 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 6758e6e12a71ef5530146161881f88df1fa43382 by Yury Selivanov in branch 'master': bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) https://github.com/python/cpython/commit/6758e6e12a71ef5530146161881f88

[issue38242] Revert the new asyncio Streams API

2019-09-29 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +16066 pull_request: https://github.com/python/cpython/pull/16482 ___ Python tracker <https://bugs.python.org/issue38

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-29 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +16067 pull_request: https://github.com/python/cpython/pull/16482 ___ Python tracker <https://bugs.python.org/issue36

[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Yury Selivanov
Yury Selivanov added the comment: > Since this has been elevated to a release blocker, I wouldn't mind helping to > revert this ASAP. I can open a PR to fix it today. Sure, by all means, any help would be hugely appreciated. Thank you, Kyle. You'll need to be careful to only revert t

[issue37141] Allow multiple separators in Stream.readuntil

2019-09-26 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> later status: open -> pending ___ Python tracker <https://bugs.python.org/issue37141> ___ ___ Python-bugs-

[issue37141] Allow multiple separators in Stream.readuntil

2019-09-26 Thread Yury Selivanov
Yury Selivanov added the comment: I already mentioned that in the PR, but we'll have to hit a pause on this. We decided to revert the latest streams implementation from 3.8, see https://bugs.python.org/issue38242. The upshot is that what we have in 3.9 should be more amenable for things

[issue38242] Revert the new asyncio Streams API

2019-09-24 Thread Yury Selivanov
Yury Selivanov added the comment: I slept on this and discussed this issue privately with a few non-involved people who use asyncio daily. My final opinion on this issue: we must revert the new streaming API from asyncio and take our time to design it properly. I don't like what we have

[issue38242] Revert the new asyncio Streams API

2019-09-23 Thread Yury Selivanov
Yury Selivanov added the comment: > So like... both of these approaches are definitely possible, but to me it > seems like if you look at it holistically, your approach is actually making > the documentation and deprecations *more* complicated, not less. I think Nathaniel might hav

[issue38242] Revert the new asyncio Streams API

2019-09-23 Thread Yury Selivanov
Yury Selivanov added the comment: Nathaniel, thanks for the summary! A few comments to address some points: > So Yury and I are tentatively thinking we'll make some kind of PEP for the > 3.9 timescale, probably just for the core ABCs Yes! At the very least for things like asynch

[issue38260] asyncio.run documentation does not mention its return value

2019-09-23 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: +aeros167 ___ Python tracker <https://bugs.python.org/issue38260> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38248] inconsistency in asyncio.Task between cancellation while running vs. cancellation immediately after it finishes

2019-09-22 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +15907 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16330 ___ Python tracker <https://bugs.python.org/issu

[issue38248] inconsistency in asyncio.Task between cancellation while running vs. cancellation immediately after it finishes

2019-09-22 Thread Yury Selivanov
Yury Selivanov added the comment: > The obvious fix would be to modify the 'except StopIteration' branch to > handle this case by calling super().cancel() instead of > super().set_exception(...). Yeah, I think this is the solution we should

[issue38242] Revert the new asyncio Streams API

2019-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: > Task group is another very required thing. If I choose between groups and > steams I probably invest my time into the former. We should get them in 3.9. I'm going to be working on the ExceptionGroup PEP

[issue38242] Revert the new asyncio Streams API

2019-09-20 Thread Yury Selivanov
New submission from Yury Selivanov : == Context 1. Andrew and I implemented a new streaming API in asyncio 3.8. The key idea is that there's a single Stream object, combining old StreamReader & StreamWriter APIs. On top of that, `Stream.write()` and `Stream.close()` became corout

[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-20 Thread Yury Selivanov
Yury Selivanov added the comment: > If a python piece of code imports cython code with async defs, > `asyncio.iscoroutinefunction` cannot determine that the code is async. Well, this seems to be a regression. IIRC Cython used to emulate a Python code object (__code__) for fun

[issue38164] polishing asyncio Streams API

2019-09-13 Thread Yury Selivanov
Change by Yury Selivanov : -- title: poloshing asyncio Streams API -> polishing asyncio Streams API ___ Python tracker <https://bugs.python.org/issu

[issue38164] poloshing asyncio Streams API

2019-09-13 Thread Yury Selivanov
New submission from Yury Selivanov : Summary of discussion at https://github.com/python-trio/trio/issues/1208: * `asyncio.Stream.write()` will start throwing a `DeprecationWarning` asking people to add an `await` if they didn't; * `asyncio.Stream.close()` will start throwing

[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-09-10 Thread Yury Selivanov
Yury Selivanov added the comment: (copying my GitHub message on this topic from https://github.com/python/cpython/pull/15889#issuecomment-530030002) I thought we were going to be more subtle about this. We have two scenarios: 1. Somebody creates an instance of asyncio.Lock outside

[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-09-10 Thread Yury Selivanov
Yury Selivanov added the comment: (copying my GitHub message on this topic from https://github.com/python/cpython/pull/15889#issuecomment-530030002) I thought we were going to be more subtle about this. We have two scenarios: Somebody creates an instance of asyncio.Lock outside

[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-09-10 Thread Yury Selivanov
Change by Yury Selivanov : -- Removed message: https://bugs.python.org/msg351728 ___ Python tracker <https://bugs.python.org/issue36373> ___ ___ Python-bug

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment: > it will help simplify some Mock things. Yeah, we'll need to chat about that so I can use Mock requirements in the PEP. :) -- ___ Python tracker <https://bugs.python.org/issu

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment: FWIW I've been using TaskGroups in EdgeDB codebase extensively: https://github.com/edgedb/edgedb/blob/master/edb/common/taskgroup.py (you can use the code, it's Apache 2) The only thing that prevented us from merging them in 3.8 is that we need to formally

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment: We want to add TaskGroups to asyncio (a similar concept to Trio's nurseries). TaskGroups use the `async with` statement to clearly define where Tasks are created and at which point they are expected to be completed or destroyed. asyncio.gather

[issue38066] Hide internal asyncio.Stream methods

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment: BTW, if we are doing this -- maybe not expose the underlying transport at all? I don't like that we do that currently, and there multiple ways for the user to screw up the Stream object (and potentially break start_tls()/sendfile() etc

[issue33523] loop.run_until_complete re-entrancy to support more complicated codebases in transition to asyncio

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment:  -- ___ Python tracker <https://bugs.python.org/issue33523> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment: > What do you think of the "shutdown_default_executor()" name? Yeah, I think it's a better name! -- ___ Python tracker <https://bugs.pytho

[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2019-09-09 Thread Yury Selivanov
Yury Selivanov added the comment: Here's the API I propose to solve this problem: https://github.com/python/cpython/pull/15735#pullrequestreview-285389412 Summary: * Add a new loop.shutdown_threadpool() method. Just like with shutdown_asyncgens() -- it would be invalid to call

[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-08-23 Thread Yury Selivanov
Yury Selivanov added the comment: Andrew, can you fix ctrl-c/windows issue? I'm basically afk until monday. And we're not going to do anything about add_signal_handler in 3.8. -- ___ Python tracker <https://bugs.python.org/issue34

[issue37398] contextlib.ContextDecorator decorating async functions

2019-08-12 Thread Yury Selivanov
Yury Selivanov added the comment: > I think a simple iscoroutinefunction check will be pretty close to 100% > matching what users expect. Yes, "pretty close", but not reliable. :) E.g. I can easily design a decorator that when applied first would break the proposed isc

[issue37398] contextlib.ContextDecorator decorating async functions

2019-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: > I hear you on the semantic confusion, but is a single check at definition > time really that expensive? Do you know how to make that single check 100% reliable? -- ___ Python tracker <https://bugs.p

[issue37373] Configuration of windows event loop for libraries

2019-06-23 Thread Yury Selivanov
Yury Selivanov added the comment: +1 to what Ben said. Andrew, > The proposal looks like a very dirty hack and smells as it is. I wonder why are you feeling like that about this idea. I don't think this is a hack at all. There's no native API, so we're forced to use another appro

[issue37373] Configuration of windows event loop for libraries

2019-06-22 Thread Yury Selivanov
Yury Selivanov added the comment: Andrew, > Sorry, no. There is no way IIUC. Well, in this case we should do that via a thread+select approach as I and Ben suggested. I can write some PoC code; will you have some time to polish it and commit it? (I'm OOO and don't have a windows mach

[issue37373] Configuration of windows event loop for libraries

2019-06-22 Thread Yury Selivanov
Yury Selivanov added the comment: Victor, Andrew, I'm not an expert in IOCP, but is it possible to implement add_reader/writer in ProactorEventLoop? If there's no native API for that, I guess we can spawn a thread with a 'select()' call to emulate this API? Lukasz, Another question

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-11 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker <https://bugs.python.org/issue37213> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2019-06-06 Thread Yury Selivanov
Yury Selivanov added the comment: Yeah, we have the SSL reimplementation ready to be backported from uvloop to cpython. Fantix, the original author, should be able to do that soon. -- ___ Python tracker <https://bugs.python.org/issue37

[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-06-03 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker <https://bugs.python.org/issue33694> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-30 Thread Yury Selivanov
Yury Selivanov added the comment: > Not sure if we have to drop this warning, it enforces writing good code that > controls all created resources lifecycle. Right, maybe we add "transport.terminate()" as well? Synchronously & immediately closing a transport is a val

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-30 Thread Yury Selivanov
Yury Selivanov added the comment: > Sorry, that's how asyncio is designed. Andrew, couldn't we provide a "stream.terminate()" method (not a coroutine) that would do the following: * close the transport * set a flag in the protocol that the stream has been terminated. When the

[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov
Yury Selivanov added the comment: Eric, regarding signals no longer using pending calls -- interesting, I'll take a look. Thanks for pointing this out. Sent from my iPhone -- ___ Python tracker <https://bugs.python.org/issue37

[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov
Yury Selivanov added the comment: > As to exposing Py_AddPendingCall() as sys.addpendingcall, that might be > opening a can of worms. Injecting code into the eval loop at some arbitrary > ("soon") future time requires care and the code isn't well exercised > h

[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov
New submission from Yury Selivanov : When asyncio event loop is created in a non-main thread, it needs to initialize a so called ChildWatcher for it (a helper object to intercept subprocesses exits). Doing that requires to run code in the main thread. I propose to add a 'sys.addpendingcall

[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +13550 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13656 ___ Python tracker <https://bugs.python.org/issu

[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-28 Thread Yury Selivanov
Yury Selivanov added the comment: > Yuri, I think we should deprecate explicit loop everywhere in non-deprecated > asyncio API by Python 3.8. +1 -- ___ Python tracker <https://bugs.python.org/i

[issue37028] Implement asyncio repl

2019-05-27 Thread Yury Selivanov
Yury Selivanov added the comment: > I suggest "Python asyncio REPL 3.8.0a4+ (...)". I prefer to keep "Python" > somewhere. Sure. > Is "exiting asyncio REPL..." message really helpful? If exit can block, would > it possible to only display a me

[issue37047] Refactor AsyncMock setup logic in create_autospec

2019-05-27 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37047] Refactor AsyncMock setup logic in create_autospec

2019-05-27 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset ff6b2e66b19a26b4c2ab57e62e1ab9f3d94dd76a by Yury Selivanov (Xtreak) in branch 'master': bpo-37047: Refactor AsyncMock setup logic for autospeccing (GH-13574) https://github.com/python/cpython/commit/ff6b2e66b19a26b4c2ab57e62e1ab9f3d94dd76a

[issue32528] Change base class for futures.CancelledError

2019-05-27 Thread Yury Selivanov
Yury Selivanov added the comment: Done. 爛 we don't regret this. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32528] Change base class for futures.CancelledError

2019-05-27 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 431b540bf79f0982559b1b0e420b1b085f667bb7 by Yury Selivanov in branch 'master': bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528) https://github.com/python/cpython/commit/431b540bf79f0982559b1b0e420b1b085f667bb7

[issue37028] Implement asyncio repl

2019-05-27 Thread Yury Selivanov
Yury Selivanov added the comment: The REPL has been merged to 3.8. It's not perfect though -- a ^C might break the asyncio event loop, sometimes ^C stops working altogether. We'll investigate all these issues in follow up PRs. -- stage: patch review -> resolved status: o

[issue37028] Implement asyncio repl

2019-05-27 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 16cefb0bc7b05c08caf08525398ff178c35dece4 by Yury Selivanov in branch 'master': bpo-37028: asyncio REPL; activated via 'python -m asyncio'. (GH-13472) https://github.com/python/cpython/commit/16cefb0bc7b05c08caf08525398ff178c35dece4

[issue37028] Implement asyncio repl

2019-05-23 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +13446 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue37028> ___ ___ Py

[issue37028] Implement asyncio repl

2019-05-23 Thread Yury Selivanov
New submission from Yury Selivanov : Having an asyncio enabled repr where a top-level "await" possible would be a huge productivity boost. Using asyncio.run() in a REPL is hard, and besides it spawns a new event loop on every call. The big idea: we want users to be

[issue37027] Return a safe proxy over a socket from get_extra_info('socket')

2019-05-23 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +13444 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue37027> ___ ___ Py

[issue37027] Return a safe proxy over a socket from get_extra_info('socket')

2019-05-23 Thread Yury Selivanov
Change by Yury Selivanov : -- components: +asyncio nosy: +asvetlov versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue37027> ___ ___ Pytho

[issue37027] Return a safe proxy over a socket from get_extra_info('socket')

2019-05-23 Thread Yury Selivanov
New submission from Yury Selivanov : Currently asyncio exposes the underlying transport socket directly, providing a way to modify (in a potentially disruptive way) the underlying transport connection. -- messages: 343332 nosy: yselivanov priority: normal severity: normal status

[issue32528] Change base class for futures.CancelledError

2019-05-23 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +13442 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32528> ___ ___ Py

[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov
Yury Selivanov added the comment: > And I'm guessing you will collect what's in NEWS.d ? Otherwise I'm happy to > contribute some text. let me know the best way. Would be great if you could make a PR to add an entry to whatsnew/3.8.rst (as Victor su

[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov
Yury Selivanov added the comment: > Would it be possible to document this change in What's New in Python 3.8? Yes, Elvis and I will take care of that later. -- ___ Python tracker <https://bugs.python.org/issu

[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +13385 ___ Python tracker <https://bugs.python.org/issue34616> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36999] Expose the coroutine object in asyncio task objects

2019-05-21 Thread Yury Selivanov
Yury Selivanov added the comment: I've no problem with this. We can add a 'get_coro()' Task method (this is in line with asyncio usually having the "getter" api as opposed to properties). -- ___ Python tracker <https://bugs.python.o

[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34616> ___ ___

[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 565b4f1ac7304d1e690c404ca8316f383ba60862 by Yury Selivanov (Matthias Bussonnier) in branch 'master': bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148) https://github.com/python/cpython/commit

[issue34616] implement "Async exec"

2019-05-15 Thread Yury Selivanov
Yury Selivanov added the comment: I'll be working on CPython on Friday. Will take a look at your PR first thing. -- ___ Python tracker <https://bugs.python.org/issue34

[issue36840] Add stream.abort() async method

2019-05-07 Thread Yury Selivanov
Yury Selivanov added the comment: If we're just calling socket.close(), then what's the point of waiting for connection_lost? (I remember us discussing this, but I don't quite remember the details). Usually .abort() is a synchronous method, which kind of signals that "i want to

[issue34616] implement "Async exec"

2019-05-04 Thread Yury Selivanov
Yury Selivanov added the comment: Here's a VERY rough first implementation to play with: https://github.com/1st1/cpython/commit/ad2ed0aed922d7c36f2fced64264124613e37f09 -- ___ Python tracker <https://bugs.python.org/issue34

[issue34616] implement "Async exec"

2019-05-01 Thread Yury Selivanov
Yury Selivanov added the comment: > No, I do not have a patch. I can provide a few test case That would be helpful! > and I am happy to spend some task to sit-down and discuss what we exactly do > so far in IPython. I'm flying back Sunday morning. Yes, let's do that around Friday

[issue34616] implement "Async exec"

2019-05-01 Thread Yury Selivanov
Yury Selivanov added the comment: > Yeah, I think this is pretty simple: the runtime/stdlib should provide the > primitives to compile top-level async code, get coroutines, etc., and then a > REPL like ipython can take care of handing that off to asyncio or whatever > libra

[issue36428] Support AutoAwait?

2019-03-25 Thread Yury Selivanov
Yury Selivanov added the comment: Absolutely. I think there's another open issue for this and I even have a dev branch somewhere with this idea half implemented. Definitely something to have in 3.8. -- ___ Python tracker <ht

[issue34745] asyncio ssl memory leak

2019-03-17 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset f683f464259715d620777d7ed568e701337a703a by Yury Selivanov (Fantix King) in branch 'master': bpo-34745: Fix asyncio sslproto memory issues (GH-12386) https://github.com/python/cpython/commit/f683f464259715d620777d7ed568e701337a703a

[issue35760] test_asyncio: test_async_gen_asyncio_gc_aclose_09() race condition

2019-03-12 Thread Yury Selivanov
Yury Selivanov added the comment: > I guess it fails only for less difference in time like 0.01 and 0.001. Yeah, that's what I was thinking. 0.1 seconds is still too tight, a simple GC pause can skew the timers and break the test logic. Maybe we should just increase the sleep to 0.5 o

[issue35760] test_asyncio: test_async_gen_asyncio_gc_aclose_09() race condition

2019-03-12 Thread Yury Selivanov
Yury Selivanov added the comment: Can you change "await asyncio.sleep(0.01)" to "await asyncio.sleep(1)" and check if the test still fails? (IOW see if there's a bug in Python's async gen implementation or this is simply ca

[issue30831] Inconsistent or wrong documentation around Asynchronous Context Manager

2019-03-07 Thread Yury Selivanov
Yury Selivanov added the comment: I also recommend reading this page https://docs.python.org/3/library/asyncio-task.html to get a better grasp on coroutines and how they are evaluated. -- ___ Python tracker <https://bugs.python.org/issue30

[issue30831] Inconsistent or wrong documentation around Asynchronous Context Manager

2019-03-07 Thread Yury Selivanov
Yury Selivanov added the comment: There's no inconsistency here and the docs are correct. If you have a function: async def foo(): pass Then "foo()" call returns a "coroutine", which is an awaitable. So async def __aenter__(): ... always returns an a

[issue33346] Syntax error with async generator inside dictionary comprehension

2019-03-06 Thread Yury Selivanov
Yury Selivanov added the comment: Yes, I have exactly the same thoughts as Nathaniel about this. The bug should be fixed, and the algorithm should be as follows (quoting Nathaniel): > So, I would expect the rule to be, precisely: if an async list/dict/set > comprehension occurs

[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-02-27 Thread Yury Selivanov
Yury Selivanov added the comment: > And the same tokenizer trick that detects 'async def' could detect 'async > for' easily. Exactly. I just never thought that we could support async generator expressions with the kind of hacks in tokenizer we had in 3.5-3.6. FWIW I still b

[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-02-27 Thread Yury Selivanov
Yury Selivanov added the comment: > But why would we? I already have a working solution. I've heard some complaints that it's hard to migrate to Python 3.7 because async and await are keywords (although I think by now all popular libraries have migrated already), so in case you e

[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-02-27 Thread Yury Selivanov
Yury Selivanov added the comment: Actually, I think we could revert to old lexer hacks in 3.8 if we modify them to treat 'async for' tocken sequence as one meta-tocken. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-02-27 Thread Yury Selivanov
Yury Selivanov added the comment: Well, it's not just rolling back async/await from being keywords. Since 3.7 it's possible to create async generator expressions in non-async functions. This wasn't possible to do with old hacks on the lexer. So if you want to revert the change you risk

[issue32363] Deprecate task.set_result() and task.set_exception()

2019-02-19 Thread Yury Selivanov
Yury Selivanov added the comment: >> There's no clear reason to complicate the Task<->coroutine relationship by >> allowing to inject arbitrary exceptions into running coroutines. > My comment was more about CancelledError rather than arbitrary exceptions. > You

[issue32363] Deprecate task.set_result() and task.set_exception()

2019-02-19 Thread Yury Selivanov
Yury Selivanov added the comment: > One reason why Task.cancel() is an incomplete replacement for > Task.set_exception() is that you don't have an easy way to communicate why > the task was ended. The result of the Task is bound to the result of the coroutine it wraps. If the

[issue34433] cancel all other pending child futures

2019-02-14 Thread Yury Selivanov
Yury Selivanov added the comment: This is a backwards incompatible change, unfortunately. Wait for the new TaskGroups API that will resolve this issue. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed _

<    1   2   3   4   5   6   7   8   9   10   >