Tin Tvrtković added the comment:
The asyncio TaskGroup already uses a WeakSet for its children, so it's suitable
for long-lived use.
As for errors in siblings aborting the TaskGroup, could you apply a wrapper to
the scheduled coroutines to swallow and log any errors yourself?
Apart from
Change by Tin Tvrtković :
--
pull_requests: +29682
pull_request: https://github.com/python/cpython/pull/31559
___
Python tracker
<https://bugs.python.org/issue46
Change by Tin Tvrtković :
--
nosy: +tinchester
nosy_count: 6.0 -> 7.0
pull_requests: +29664
pull_request: https://github.com/python/cpython/pull/31513
___
Python tracker
<https://bugs.python.org/issu
Change by Tin Tvrtković :
--
pull_requests: +29640
pull_request: https://github.com/python/cpython/pull/31513
___
Python tracker
<https://bugs.python.org/issue46
Change by Tin Tvrtković :
--
pull_requests: +29635
pull_request: https://github.com/python/cpython/pull/31508
___
Python tracker
<https://bugs.python.org/issue46
Change by Tin Tvrtković :
--
pull_requests: +29613
pull_request: https://github.com/python/cpython/pull/31483
___
Python tracker
<https://bugs.python.org/issue46
Change by Tin Tvrtković :
--
pull_requests: +29584
pull_request: https://github.com/python/cpython/pull/31434
___
Python tracker
<https://bugs.python.org/issue46
Tin Tvrtković added the comment:
@Alex you can follow along here: https://github.com/python/cpython/pull/31394
With the cancel_counter approach, a context manager knows whether to handle or
propagate the exception by examining its own local state and the remaining
counter on the task
Change by Tin Tvrtković :
--
pull_requests: +29561
pull_request: https://github.com/python/cpython/pull/31415
___
Python tracker
<https://bugs.python.org/issue46
Tin Tvrtković added the comment:
Sure, I'll be glad to work with Andrew on getting something presentable.
Going through the discussion in the issue:
* it seems like folks don't think move_on is useful enough to be in the stdlib,
I understand that point. Users can always catch the timeout
Tin Tvrtković added the comment:
Hello Andrew, here's some followup.
About the names: the move_on_after and fail_after names are from Trio. I don't
have strong feeling about them at all, whatever most people like.
About move_on_after vs loop.call_at and loop.call_later: move_on_after is much
Tin Tvrtković added the comment:
@Guido @Chris
Instead of using the message for the nonce we could have a dedicated field for
it.
I have a proposal though. It's about putting a little logic into the
cancellation nonce handling.
Let's define the nonce as a float. If you just call
Tin Tvrtković added the comment:
@Guido Imagine something_else() takes a long time and a lot of server resources
(like a heavy query). If the web server disconnected a tad later and avoided
the race condition, the task would have gotten cancelled very soon after the
start of something_else
Tin Tvrtković added the comment:
Ok, first the happy path. We have a task running this:
async def a():
with move_on_after(5):
await a_long_op()
await something_else()
`move_on_after` has scheduled a callback to run that calls
`parent_task.cancel(msg=1)` 5 seconds after
Tin Tvrtković added the comment:
On the topic of TaskGroups needing to know whether to swallow a child
CancelledError or no: just use the same nonce/cancellation context trick?
I remember asking Nathaniel about why in Trio nurseries and cancel scopes were
linked (nurseries contain a cancel
Tin Tvrtković added the comment:
The use of the cancel message is a hack, yeah. But it's what I had to work
with. We could introduce a new, proper cancellation context to Tasks instead,
which could be attached to the CancelError when it's raised.
On the topic of multiple cancellations being
Tin Tvrtković added the comment:
Oh, and Trio's `current_effective_deadline` is also in.
--
___
Python tracker
<https://bugs.python.org/issue46771>
___
___
Pytho
Tin Tvrtković added the comment:
I've essentially forked `async-timeout` (a very good library) into Quattro
cancel scopes:
https://github.com/Tinche/quattro/blob/main/src/quattro/cancelscope.py.
The differences are:
* the API follows Trio, so instead of `timeout` you'd use `fail_after
Tin Tvrtković added the comment:
I mean, I agree with your point about being able to accidentally format twice
when using the standard library logger.
I'm not a core dev but I think getting new APIs in will be challenging. And if
by some fluke of chance you did get the approval to introduce
Tin Tvrtković added the comment:
Eric is absolutely right, due to function calls being somewhat slow in Python
the performance argument in practice falls in favor of f-strings.
So if they're faster, more readable, and more convenient to write, no wonder
people prefer them (including me
New submission from Tin Tvrtković :
We've received a report over at the attrs issue tracker about our test suite
failing on Python 3.11. Here's the link:
https://github.com/python-attrs/attrs/issues/907
It turns out to be an issue with the no-arg `super()` calls in slotted classes.
Here's
Tin Tvrtković added the comment:
I was trying to instrument one of our executors to expose some metrics, so I
tried using the value of the semaphore as the number of idle threads and I
noticed it was way too large. If this was fixed getting these metrics would be
easier.
--
nosy
Tin Tvrtković added the comment:
It would be great if we could get this into 3.9.
--
___
Python tracker
<https://bugs.python.org/issue42332>
___
___
Python-bug
New submission from Tin Tvrtković :
For example, dict[int, int] cannot be used with singledispatch because
types.GenericAlias doesn't support weak references.
I'm an author of a third party library (https://github.com/Tinche/cattrs) for
which this functionality would be useful.
Here's
Tin Tvrtković added the comment:
Thanks for dealing with this, Brett, your efforts are appreciated. :)
On Thu, Jun 30, 2016 at 9:24 PM Brett Cannon <rep...@bugs.python.org> wrote:
>
> Brett Cannon added the comment:
>
> Activation doesn't "load" the Python interpre
Tin Tvrtković added the comment:
Also I will add I've been using fish for a long time and have never been
affected by #26348.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Tin Tvrtković <tinches...@gmail.com>:
--
versions: +Python 3.5
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26664>
___
Tin Tvrtković added the comment:
I'm getting this exact issue on Python 3.5 (xenial system installation).
All my existing venvs (from before my upgrade to xenial) work. Here's the diff:
> diff .venv/bin/activate.fish ../wrapt/.venv/bin/activate.fish
35c35
< set -gx VIRTUAL_ENV "/
Tin Tvrtković added the comment:
It's a shame this has been stuck in review for 2.5 years, I could really use
something like this right now.
neologix, why don't you put this up on PyPI for a while, at least?
--
nosy: +tinchester
___
Python tracker
Tin Tvrtković added the comment:
We're actually getting bitten by this in production through the Riak Python
client, so this isn't a strictly theoretical problem.
--
nosy: +tinchester
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Tin Tvrtković added the comment:
For your examples, my first instinct would be to use a thread pool executor.
It's a nice high level API and can already do the aggregate join.
--
nosy: +tinchester
___
Python tracker rep...@bugs.python.org
http
Changes by Tin Tvrtković tinches...@gmail.com:
--
nosy: +tinchester
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5207
___
___
Python-bugs-list
32 matches
Mail list logo