mojo
mojo copied to clipboard
[External] [stdlib] List.__contains__
Hello, here is List.__contains__
,
The conformance is done by hand with constrained
, _type_is_eq
and rebind
so that users can do:
var x = List[Int](1,2,3)
if 3 in x: print("ok")
If value would be T2, we would not be able to do it (this is the same PR as https://github.com/modularml/mojo/pull/2662 and https://github.com/modularml/mojo/pull/2665 , started over again)
Hey that's really awesome! I didn't know you could do that
Hello @JoeLoser , glad you like it !
Your videos and the community stream helped a lot :partying_face:
I'm learning branch in order to do multiple PR at same time !
✅🟣 This contribution has been merged 🟣✅
Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours.
We use Copybara to merge external contributions, click here to learn more.
Landed in 97eb340b9ff9ad4a0245c31c92d34f3527da72a8! Thank you for your contribution 🎉