-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
rename TASK_STATUS_IGNORED to TASK_STATUS_STUB #639
Comments
Hmm, maybe. or |
As someone reading a library implementation, if I saw TASK_STATUS_DEFAULT or TASK_STATUS_PLACEHOLDER I would assume they were a integer codes, not an object which sends method calls to /dev/null. Stub is much more descriptive. As someone reading an API (perhaps knowing that async functions need to be called with |
|
I'm not ruling it out, but I hesitate because to me
Anyone who's implementing an API that takes We could also consider structuring the name differently, e.g. |
these all sound like enumerated codes, not a mutable object to communicate task status |
maybe TASK_STATUS_SHIM or NOOP_TASK_STATUS |
Is that so bad? In your original post it sounded like your main concern was people reading the docs for APIs that use this, and reassuring them that they don't really need to understand this right now. |
Yes, it prompted wanting a rename and is the most important thing to rectify. However as an author of API's using Trio, I selfishly would like to make the name more descriptive at the same time. Having just come to Trio with new eyes, the names that threw me off the most were this and ParkingLot. These two have a higher degree of being misleading or non-descriptive than say, nursery, which has received a lot of attention. The Trio API on the whole has far better naming than most projects (nursery and start / start_soon are great examples), sincere kudos! There are only a couple of renames I can suggest that I believe are a decent value. |
Part of the issue stems from the argument name
|
The name
TASK_STATUS_IGNORED
is disconcerting to users of an async API (who may not be aware of the intricacies ofstart()
vs.start_soon()
) because it sounds like if they leave that default in place, something significant might get ignored. It's important to find a good name since this constant will appear in virtually all API's using Trio, and we can't rely on every author to document its meaning in every function signature it appears.TASK_STATUS_STUB
would be more descriptive for both API authors and users.User: : "it's a harmless default which I don't necessarily need to learn about yet"
Author: "it's a dummy object which will ignore calls to
started()
and custom/future extensions"The text was updated successfully, but these errors were encountered: