Is this pull request associated with an issue(s)?
No
Descriptioncpp_contains dispatches on the type of container it is searching. Before this PR it failed silently if the container was recognized as a type other than desc (a single element list), list, or map. This PR now adds an "else" clause which triggers when the type is anything other than map or desc (notably list is addressed by the else clause).
TODOs
Longer term the fact that there is an ambiguity between wanting cpp_contains to look for a substring and comparing against a single element list is perhaps looking for trouble. Bluntly, I suggest deprecating this function as it doesn't save that many keystrokes and it's likely to cause problems.
Is this pull request associated with an issue(s)? No
Description
cpp_contains
dispatches on the type of container it is searching. Before this PR it failed silently if the container was recognized as a type other thandesc
(a single element list),list
, ormap
. This PR now adds an "else" clause which triggers when the type is anything other thanmap
ordesc
(notablylist
is addressed by the else clause).TODOs Longer term the fact that there is an ambiguity between wanting
cpp_contains
to look for a substring and comparing against a single element list is perhaps looking for trouble. Bluntly, I suggest deprecating this function as it doesn't save that many keystrokes and it's likely to cause problems.