-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Task.eventual_parent_nursery introspection attribute #1558
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1558 +/- ##
=======================================
Coverage 99.68% 99.68%
=======================================
Files 110 110
Lines 13466 13481 +15
Branches 1024 1025 +1
=======================================
+ Hits 13423 13438 +15
Misses 28 28
Partials 15 15
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One typo + one design question
trio/_core/_run.py
Outdated
|
||
If this task has already called ``started()``, or if it was not | ||
spawned using `nursery.start() <trio.Nursery.start>`, then | ||
`eventual_parent_nursery` is the same as `parent_nursery`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have a mild preference for "if the task isn't in the middle of start
shenanigans, then eventual_parent_nursery
is None
". What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm indifferent between the two so will change it to suit your preference!
This tracks the nursery in which the task is going to run, even if it's not really running there yet because the
start()
that spawned it hasn't returned. Came up in discussion surrounding #1523 but seems independently useful.