You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #3010 we will have the following functionality:
my_move_on_at=move_on_at(5)
assertmy_move_on_at.deadline==5my_move_on_after=move_on_after(5)
assertmy_move_on_after.deadline==5# but these return Generator[CancelScope], so you can't inspect/modify the objectsmy_fail_at=fail_at(5)
assertmy_fail_at.deadline==5# AttributeErrormy_fail_after=fail_after(5)
assertmy_fail_after.deadline==5# AttributeError
Since separating initialization & entry has been weird previously the current demand might be low for this functionality, but it might become more common.
The two ways I see of fixing this are:
Add a wrapper class that defines __exit__ to raise TooSlowError if cancelled_caught, but otherwise passes __getattr__ and __setattr__ onto CancelScope
Add a fail=True parameter to CancelScope that makes it raise TooSlowError upon being cancelled.
After #3010 we will have the following functionality:
Since separating initialization & entry has been weird previously the current demand might be low for this functionality, but it might become more common.
The two ways I see of fixing this are:
__exit__
to raiseTooSlowError
ifcancelled_caught
, but otherwise passes__getattr__
and__setattr__
ontoCancelScope
fail=True
parameter toCancelScope
that makes it raiseTooSlowError
upon being cancelled.Split out from #3010 (comment)
The text was updated successfully, but these errors were encountered: