-
Notifications
You must be signed in to change notification settings - Fork 361
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
Subscribe signature(s) #430
Comments
This is the rx v1 behavior, i.e. the 2 following examples would work: This was discussed from this comment, when callbacks were only allowed in |
Ah thanks, I had a feeling this came before but I could not find it! So my takeaway from re-reading that thread, the consensus seems to be that Other than the names of the functions, which hopefully my IDE will help me with, I think I’m pretty close to making that work. |
It makes sense to call Yes, we would need something like |
I've started using RxPy recently, and I have a question about the signature of In other languages with which I've used Rx API, they usually provide a typed variant of So, I was surprised to find that the equivalent in RxPy only provides an untyped version, even though Is there a reason why we can't add a type hint to the more convenient version of |
This is fixed in the latest --pre release and will be fixed in the latest major release. There's only one subscribe now taking 3 callbacks (or 1 observer). |
I'm confused about
Observable.subscribe
andObservable.subscribe_
. If we have the latter, why should the former have to be polymorphic? The reason I ask is I'm trying to reduce the typehint warnings, and mypy is unhappy about the difference betweenSubject.subscribe
and the signature intyping.Observable
...If I can get things to work, would it make sense to simply have
subscribe
accept a single argument (typeObserver
) and letsubscribe_
handle the case of varying number of callbacks? And actually, the signature intyping.Observable.subscribe
also seems a bit off, it says theObserver
argument is optional, but does it make sense to invoke this method without an observer?I'm probably missing some history here, sorry if this is a silly question...
The text was updated successfully, but these errors were encountered: