-
Notifications
You must be signed in to change notification settings - Fork 2
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
Document BaseFuture semi-private methods. #225
Comments
Possible updates needed:
|
In addition to documentation, I'd like to mention that |
Thanks, yes; that's a good point. I've never been quite happy with the exception marshalling (for one thing, in Python 3, with tracebacks attached to the exception objects, we should have no need at all to marshal exceptions across threads), and it's a part of the codebase that's been pretty much untouched since version 0.0.0. There's room for a rethink there at some point before the 1.0.0 release. But yes, as things stand it really needs to be a part of the public (or at least the testing) API. It may make sense to grow a |
Not in this release. |
The semi-private methods of the
BaseFuture
class are depended on by the executor machinery. They're useful for unit-testing for projects using Traits Futures: if you want to test side-effects resulting from state changes to aFuture
class, it's useful to be able to simulate the results of a running background job.Those methods currently appear to be private, via the usual leading underscore convention. We need to document that they're safe to use, and that backwards compatibility will be taken into account when making updates.
Specifically, the methods of interest are these ones:
traits-futures/traits_futures/base_future.py
Lines 242 to 327 in 3180201
Note that in contrast, the
_state
,_cancel
,_result
and_exception
attributes are genuinely private, and should not be depended on by users.Looking at the methods above, there's a bit of cleanup to be done (e.g., the
_cancel
trait can get set toNone
multiple times, which is inelegant), but I think we can guarantee not to change the names of any of those methods without warning.We may also possibly want to create a formal interface (likely inheriting from
IFuture
) encapsulating those methods.The text was updated successfully, but these errors were encountered: