-
Notifications
You must be signed in to change notification settings - Fork 16
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
use_memo should warn/throw if passed anything but an array for dependencies #355
Comments
@mattrunyon it wasn't a dict, it was a |
Ya I just updated my comment here. It should just be |
After discussion, definitely should not be allowing sets - the order definitely matters, e.g.
|
ah, yeah, a set is too permissive and would be too much hassle to make work even if it didn't have the issue of dropping duplicate items |
Fixes #355 Only allow tuple and list, and throw if neither.
Related to #354 where we accidentally had a dictionary instead of an array for the dependencies of
use_memo
. We should at least warn (maybe throw) that memoization will not happen properly if a non-array is passedI also don't think the dependencies typehint is right.
set[Any] | Sequence[Any]
. Sets are unordered, so you could cache miss just based on set iteration order. Sequences contain list, tuple, and range. Range doesn't really make sense IMO. List vs tuple I could see either being valid. From what I can find, tuples are immutable and a little bit more performant than listsThe text was updated successfully, but these errors were encountered: