Skip to content
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

inArray / notInArray strict equality inconsistency #246

Open
maryo opened this issue Feb 16, 2018 · 4 comments
Open

inArray / notInArray strict equality inconsistency #246

maryo opened this issue Feb 16, 2018 · 4 comments

Comments

@maryo
Copy link
Contributor

maryo commented Feb 16, 2018

inArray is an alias for choice. It passes true as third argument of in_array.
On the other hand, notInArray does not use the third argument when calling in_array (=false). Is this intentional?

Shouldn't there be both versions?

@rquadling
Copy link
Contributor

notInArray was initial drafted back in July 2016. I've asked the original author of the assertion to see if they have any opinion. As things stand, I suspect it was just an oversight.

Unless there's any specific feedback, I'll make both use strict comparison and release that next week.

@mdavis1982
Copy link
Contributor

This wasn't intentional 😄 Definitely just an oversight!

@TomasVotruba
Copy link
Contributor

👍

@maryo
Copy link
Contributor Author

maryo commented Feb 16, 2018

@rquadling I've actually noticed it when I needed loose comparison :-). I know loose comparison is not as usual but if both inArray and choice do exactly the same then there is no loose assertion available. Maybe it's OK. Maybe there could be something like looseInArray to make it explicit without introducing a BC break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants