You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe we can't implement __len__ reactively, but can't we provide a better error message in this case? E.g. it seems like we could print a warning saying that the value returned won't be reactive (and what to do instead (.rx.len()), and then return the non-reactive length.
I'm not sure if there are any other such methods where we can similarly help guide the rx user towards correct code with less pain.
The text was updated successfully, but these errors were encountered:
Right now, len(x) on a reactive expression gives an error even on objects that do have a length:
I believe we can't implement
__len__
reactively, but can't we provide a better error message in this case? E.g. it seems like we could print a warning saying that the value returned won't be reactive (and what to do instead (.rx.len()
), and then return the non-reactive length.I'm not sure if there are any other such methods where we can similarly help guide the rx user towards correct code with less pain.
The text was updated successfully, but these errors were encountered: