[issue44886] asyncio: create_datagram_endpoint() does not return a DatagramTransport

2022-02-24 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-24 Thread Andrew Svetlov
Andrew Svetlov added the comment: I personally don't think that the described opt-in trick should be a part of asyncio. A third-party library that patches asyncio.create_task() can be a useful thing though during the transition period. We even cannot deprecate asyncio.create_task() right now

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: -1 Now bare `create_task()` does fire-and-forget action. After the proposed change it will fail loudly. Even if this behavior is better it is not backward compatible. People start blaming and asking "how to return everything

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Clear, thanks! -- ___ Python tracker <https://bugs.python.org/issue46771> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: I have no good simple real-case scenario, sorry. There is a demonstration of my thoughts. Suppose we have a custom context manager that behaves similar to timeout() but is controlled not by timer but external event source (it could be an invalidation

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Serhiy is right, Condition.wait() has the following code: finally: # Must reacquire lock even if wait is cancelled cancelled = False while True: try: await self.acquire

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks, Raymond. I agree that caching of iterators and generators is out of the issue scope. Also, I agree that a separate async cache decorator should be added. I prefer the `async_lru_cache` (and maybe `async_cache` for the API symmetry). We have

[issue46771] Add some form of cancel scopes

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: If some code is used together with timeout() and this code calls `.cancel()` but forgot about `.uncancel()` in try/except/finally -- timeout() never raises TimeoutError. Should we care? The missing `.uncancel()` call is hard to detect by the runtime

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue46522> ___ ___

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: -Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46522> ___ ___ Python-bugs-list mailin

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 9b12b1b803d7b73640ab637a74a6f35f3fe9db21 by Thomas Grainger in branch 'main': bpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887) https://github.com/python/cpython/commit/9b12b1b803d7b73640ab637a74a6f35f3fe9db21

[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: Deprecation is a good answer. Let's not forget to apply it to 3.11 then. -- ___ Python tracker <https://bugs.python.org/issue46

[issue43119] asyncio.Queue.put never yields if the queue is unbounded

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, that's how asyncio works: it never switches to another task if `await ...` doesn't need to wait for something actually. Adding `await asyncio.sleep(0)` to every call decreases performance. -- resolution: -> wont fix stage: patch rev

[issue45883] reuse_address mistakenly removed from loop.create_server

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44886] asyncio: create_datagram_endpoint() does not return a DatagramTransport

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- assignee: -> asvetlov ___ Python tracker <https://bugs.python.org/issue44886> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue44886] asyncio: create_datagram_endpoint() does not return a DatagramTransport

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.10, Python 3.11 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue44886> ___ ___ Python-bugs-list m

[issue44886] asyncio: create_datagram_endpoint() does not return a DatagramTransport

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +29639 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31512 ___ Python tracker <https://bugs.python.org/issu

[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-02-22 Thread Andrew Svetlov
New submission from Andrew Svetlov : Suppose multiple `task.cancel(msg)` with different messages are called on the same event loop iteration. What message (`cancel_exc.args[0]`) should be sent on the next loop iteration? As of Python 3.10 it is the message from the *last* `task.cancel(msg

[issue45146] Add a possibility for asyncio.Condition to determine the count of currently waiting consumers

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, your use-case looks not convincing but overcomplicated. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7 by Thomas Grainger in branch 'main': bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499) https://github.com/python/cpython/commit/8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7

[issue46622] Support decorating a coroutine with functools.lru_cache

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- title: Support decorating a coroutine with functools.cached_property -> Support decorating a coroutine with functools.lru_cache ___ Python tracker <https://bugs.python.org/issu

[issue46818] Proper way to inherit from collections.abc.Coroutine

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: > Are you suggesting that I need to just inherit from Awaitable? Yes. Awaitable is a very base protocol, Coroutine is an implementation. `__await__` returns a generator that is used by Python internals as if `yield from awaitable.__await__()` was cal

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: Could you provide more context for the proposed change? -- ___ Python tracker <https://bugs.python.org/issue46824> ___ ___

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-22 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 4140bcb1cd76dec5cf8d398f4d0e86c438c987d0 by Andrew Svetlov in branch 'main': bpo-45390: Propagate CancelledError's message from cancelled task to its awaiter (GH-31383) https://github.com/python/cpython/commit

[issue46818] Proper way to inherit from collections.abc.Coroutine

2022-02-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: You don't need send()/throw()/close() methods. aiohttp had them to work with Python 3.5 P.S. Please don't use the bug tracker as Q site. -- resolution: -> not a bug stage: -> resolved status: open -&g

[issue46796] Simplify handling of removed parameter "loop" in asyncio

2022-02-21 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46796] Simplify handling of removed parameter "loop" in asyncio

2022-02-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca by Serhiy Storchaka in branch 'main': bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431) https://github.com/python/cpython/commit/195a46d6ffd4cec6c5fb69c5890f8b

[issue46805] Add low level UDP socket functions to asyncio

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, I was not clear maybe. Newly added methods can have a `flag` argument from the very beginning. Adding a flag to already existing methods requires a separate issue. -- ___ Python tracker <ht

[issue46771] Add some form of cancel scopes

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: > This should be solved when using the cancel count -- the explicit cancel > bumps the cancel count so the cancel scope (i.e. timeout()) will not raise > TimeoutError. Hmmm. Interesting! Timeouts are not the single primitive that should c

[issue46771] Add some form of cancel scopes

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: Alex, the 'scope' argument can be added if it is really required. I'm not sure if the nonce is unavoidable still. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46771] Add some form of cancel scopes

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: Updated https://github.com/python/cpython/pull/31394 demonstrated the approach with global dict for counters. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46771] Add some form of cancel scopes

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: In docs we can explain the behavior as "the outer expired timeout cancels the inner waiter, waits for CancelError bubbling up, and raising TimeoutError instead". I agree that a counter is required for this behavior. An alternative implementati

[issue46672] NameError in asyncio.gather when passing a invalid type as an arg with multiple awaitables

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.or

[issue46672] NameError in asyncio.gather when passing a invalid type as an arg with multiple awaitables

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset f1916cde24053f4c8b6799730666d19474f8dd09 by Miss Islington (bot) in branch '3.10': bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187) (GH-31440) https://github.com/python/cpython/commit

[issue46771] Add some form of cancel scopes

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: Suppose we have a case when two nested timeouts are reached at the same event loop iteration: async def asyncio.timeout(1) as cm1: async with third_party_cm() as cm2: async def asyncio.timeout(1) as cm3: async with third_party_cm

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46672] NameError in asyncio.gather when passing a invalid type as an arg with multiple awaitables

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset a6116a980c9eae91c2f9af7cbd0a9727e9b887ba by Andrew Svetlov in branch '3.9': [3.9] bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187) (GH-31441) https://github.com/python/cpython/commit

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29575 pull_request: https://github.com/python/cpython/pull/31444 ___ Python tracker <https://bugs.python.org/issue46

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29574 pull_request: https://github.com/python/cpython/pull/31443 ___ Python tracker <https://bugs.python.org/issue46

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: The issue can be backported. It doesn't change existing behavior but raises a better error. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue46252> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46805] Add low level UDP socket functions to asyncio

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: A separate issue for 'flags' adding looks better. The reason for missing is an oversight I think. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29573 pull_request: https://github.com/python/cpython/pull/31442 ___ Python tracker <https://bugs.python.org/issue46

[issue46252] Forbid passing SSLSocket into asyncio methods

2022-02-20 Thread Andrew Svetlov
New submission from Andrew Svetlov : SSLSocket is a blocking object by definition, it is not compatible with asyncio. asyncio has a check for SSLSocket in sock_*() operations, it should be extended to transport-based API -- title: SSLWantReadError causes _SelectorSocketTransport

[issue46672] NameError in asyncio.gather when passing a invalid type as an arg with multiple awaitables

2022-02-20 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29572 pull_request: https://github.com/python/cpython/pull/31441 ___ Python tracker <https://bugs.python.org/issue46

[issue46672] NameError in asyncio.gather when passing a invalid type as an arg with multiple awaitables

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 4ab8167b9c60d1a04b2e3116d0c52db254b68cda by Nikita Sobolev in branch 'main': bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187) https://github.com/python/cpython/commit/4ab8167b9c60d1a04b2e3116d0c52db254b68cda

[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset e7130c2e8c6abfaf04b209bd5b239059eda024b9 by Andrew Svetlov in branch 'main': bpo-46752: Uniform TaskGroup.__repr__ (GH-31409) https://github.com/python/cpython/commit/e7130c2e8c6abfaf04b209bd5b239059eda024b9

[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-18 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29550 pull_request: https://github.com/python/cpython/pull/31409 ___ Python tracker <https://bugs.python.org/issue46

[issue46771] Add some form of cancel scopes

2022-02-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: > the third case the behavior is wrong, the `.cancel()` should win over the > timeout. Otherwise using the context manager becomes too risky in real-world > situations. Please elaborate. The first code that calls `.cancel()` wins, doesn't mat

[issue46771] Add some form of cancel scopes

2022-02-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: Guido, the third case: The third edge case is: explicit cancel() happened *after* the timeout (but still in the same iteration)? timeout current-iteration (calls .cancel() after timeout) next-iteration

[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: > 6. The loop parameter of Task() was documented as both removed and required > (if there is no current event loop) in 3.10. I think we should drop Task() constructor definition from Task Object docs https://docs.python.org/3/library/asyncio-task.htm

[issue45099] asyncio.Task's documentation says that loop arg is removed when it's not

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: I have a feeling that we need a low-level API section that describes *supported* API that is intended to task extenders only (guys who want to provide an alternative task factory for example). I love to contribute but not sure when I can find time

[issue46771] Add some form of cancel scopes

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: The PR is pretty empty, it has a scaffolding for `asyncio.timeouts` module and its test only. I'll try to add something real tomorrow. My plan is: - solve 'easy' questions with Tin during PR's discussion/reviews - make something that we are both agree

[issue46771] Add some form of cancel scopes

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: https://github.com/python/cpython/pull/31394 is created for collaboration , Tin Tvrtković is invited. Core devs should have the write access already. Non-core devs, please ask for github invite if you want to collaborate

[issue46771] Add some form of cancel scopes

2022-02-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29539 pull_request: https://github.com/python/cpython/pull/31394 ___ Python tracker <https://bugs.python.org/issue46

[issue46771] Add some form of cancel scopes

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: I support Alex Grönholm: TaskGroup is not affected by cancellation races because it doesn't convert the exception or swallows it. The code is safe from my understanding. -- ___ Python tracker <ht

[issue46771] Add some form of cancel scopes

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: The discussion is hot, I see several interleaved threads. Let me put my answers on all of them in order of appearance. 1. quattro cancellation scopes are implemented after async-timeout. As the author of async-timeout I am happy to know it. The module

[issue45098] asyncio.CancelledError should contain more information on cancellations

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: After TaskGroup merging, the second `cancel()` call returns `False` and doesn't initiate the actual cancellation if it was scheduled by the first `cancel()` call. I believe it "fixes" async-timeout: the first canc

[issue45099] asyncio.Task's documentation says that loop arg is removed when it's not

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: User code should not create Task objects explicitly. Please use `asyncio.create_task()` (or shiny new TaskGroup.create_task()) instead. They doesn't have 'loop' argument. -- ___ Python tracker <ht

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: I have a pull request for the issue. It doesn't use `Future.set_exception()` but creates a new CancelledError() with propagated message. The result is the same, except raised exceptions are not comparable by `is` check. As a benefit, `_cancelled_exc` works

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +29531 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31383 ___ Python tracker <https://bugs.python.org/issu

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.11 -Python 3.9 ___ Python tracker <https://bugs.python.org/issue45390> ___ ___ Python-bugs-list mailin

[issue46318] asyncio and ssl: ResourceWarning: unclosed transport

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: Please check against the latest master. It has rewritten SSL protocol implementation borrowed from uvloop. See #44011 for details -- ___ Python tracker <https://bugs.python.org/issue46

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 72c46462aa9fd0a69317917ba127e62f94ce08d7 by Miss Islington (bot) in branch '3.10': bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (GH-31327) (GH-31362) https://github.com/python/cpython/commit

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 1d81fdc4c004511c25f74db0e04ddbbb8a04ce6d by Alex Waygood in branch 'main': bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327) https://github.com/python/cpython/commit/1d81fdc4c004511c25f74db0e04ddbbb8a04ce6d

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-15 Thread Andrew Svetlov
Change by Andrew Svetlov : -- priority: critical -> normal ___ Python tracker <https://bugs.python.org/issue44011> ___ ___ Python-bugs-list mailing list Un

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: The code had landed. Need a follow-up PR with documentation update (mention new ssl_shutdown_timeout arguments) -- ___ Python tracker <https://bugs.python.org/issue44

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 13c10bfb777483c7b02877aab029345a056b809c by Kumar Aditya in branch 'main': bpo-44011: New asyncio ssl implementation (#31275) https://github.com/python/cpython/commit/13c10bfb777483c7b02877aab029345a056b809c

[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: >From my point of view, both sync and async functions can be cached. Sync and async iterators/generators are other beasts: they don't return a value but generate a series of items. The series can be long and memory-consuming, I doubt if it should be cac

[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree. Let's start from async functions support by `functools.lru_cache`. If we will have an agreement that cached_property is an important use-case we can return to this issue. I have a feeling that async lru_cache is much more important. https

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: Alex, you are right. BufferedProtocol is considered stable since 3.8 A pull request with docstring fix is welcome. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: I have a design question. Does `print(await a.hello)` look awkward? I'm not speaking about correction. In asyncio code I have seen before, `await val` means waiting for a future object. `await func()` means async function call. `await obj.attr` looks more

[issue43216] Removal of @asyncio.coroutine in Python 3.11

2022-02-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: Closed. Thanks for the reminder! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46708> ___ ___ Python-bugs-list mailin

[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29424 pull_request: https://github.com/python/cpython/pull/31256 ___ Python tracker <https://bugs.python.org/issue46

[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +29423 pull_request: https://github.com/python/cpython/pull/31255 ___ Python tracker <https://bugs.python.org/issue46

[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +29421 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31253 ___ Python tracker <https://bugs.python.org/issu

[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks for the report! Let me make a fix PR in a few minutes -- ___ Python tracker <https://bugs.python.org/issue46

[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: You can return a wrapper from __get__ that awaits the inner function and saves the result somewhere. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: Pull Request is welcome! I would say that the PR should not use asyncio directly but 'async def', 'await', and `inspect.iscoroutine()` / `inspect.iscoroutinefunction()` instead. The property should work with any async framework, not asyncio only

[issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check

2022-02-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: The change should NOT be backported, it doesn't fix any bug but clears code a little -- versions: -Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46

[issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check

2022-02-02 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check

2022-02-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 3483aa65dfebfc60a87ea9db3f20da84be41f606 by Nikita Sobolev in branch 'main': bpo-46583: remove unused `sys.version_info` check from `selectors` (GH-31023) https://github.com/python/cpython/commit/3483aa65dfebfc60a87ea9db3f20da84be41f606

[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: Done, thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 64568acbd88a88d54ac9b8215447f88280448dd5 by Emiya in branch 'main': bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports (GH-30958) https://github.com/python/cpython/commit/64568acbd88a88d54ac9b8215447f88280448dd5

[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: -Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue46487> ___ ___ Python-bugs-list mailin

[issue45339] concurrent.future.ThreadPoolExecutor should parameterize class used for threads

2022-02-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: I guess if you are asking for initialization and finalization of thread-specific data in a thread pool -- you need exactly these things (or a context manager). A custom thread class reveals too many implementation details. I personally prefer an explicit

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: You are welcome! -- ___ Python tracker <https://bugs.python.org/issue46568> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Your version works but can be simplified. Just use await writer.drain() writer.write(data) without grabbing the drainer early. The purpose of the .drain() method is to write pausing if the write buffer side is greater than the high watermark

[issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning

2022-01-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Your code has at least one concurrency problem. Let's look back at forward_stream() function: async def forward_stream(reader: StreamReader, writer: StreamWriter, event: asyncio.Event, source: str): writer_drain = writer.drain() # <--- awaita

[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, I didn't look into docs before writing. Now we have an interesting situation: the documentation reflects the desired state already but the code is not :) The PR should contain fixes for transports.py and sslproto.py only (plus a blurb record for NEWs

[issue34680] asyncio event_loop fails when accessed from multiple threads

2022-01-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Please feel free to propose pull request for documentation tuning. -- ___ Python tracker <https://bugs.python.org/issue34

[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Forgot to write, after making the method public we can implement it in SSL transport easily. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Technically it should not provide the method according to the current design. get_write_buffer_limits() is not a part of public transports API, this method is defined by private class _FlowControlMixin only. WriteTransport requires only get_write_buffer_size

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