Simplify cancel_shielded_checkpoint ? #395
Closed
Comments
njsmith
added a commit
to njsmith/trio
that referenced
this issue
Jan 10, 2018
Hmm, you're right, that code does look kinda overcomplicated. I'd rather not create |
njsmith
added a commit
to njsmith/trio
that referenced
this issue
Jan 10, 2018
Looks good to me |
Want to click merge, then? :-) |
That would be an honor ! |
Thanks! BTW, sorry I haven't followed up with pytest-trio stuff recently -- I'm hoping to get back to that soon, maybe this weekend. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure what is the need for a mix of
yield
andasyncfunction
decorator here:trio/trio/_core/_traps.py
Lines 13 to 45 in a351a2d
From what I understand, it is because an awaited object must be of a type with an
__await__
method.But in such a case there could be a much simpler wait to do this:
This way
CancelShieldedCheckpointType
is just a helper class (hence destroyed as soon at it is no longer needed) andCancelShieldedCheckpoint
is still a singleton, this time compatible withawait
syntax.The text was updated successfully, but these errors were encountered: