modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo
Other
21.91k stars 2.53k forks source link

[mojo-stdlib] Add variadic initialiser, __iter__ and __contains__ to InlineList #2703

Closed ChristopherLR closed 3 weeks ago

ChristopherLR commented 4 weeks ago

This PR adds some features to InlineList ( related issue #2658 )

Variadic initialiser

var x = InlineList[Int](1,2,3)

iter

var x = InlineList[Int](1,2,3)
for i in x:
    print(i)

contains

var x = InlineList[Int](1,2,3)
if 3 in x: print("ok")
modularbot commented 4 weeks ago

✅🟣 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.

modularbot commented 3 weeks ago

Landed in d5b7381cf960dae9eb5a30fc0602606226a5fcd5! Thank you for your contribution 🎉