for i in range(len(b)):
    print(i)
0
1

尝试获取每个文档的值:https://docs.modular.com/mojo/stdlib/builtin/tuple.html#get

for i in range(len(b)):    
    print(b.get[i, Int32]())

错误:

error: Expression [61]:20:21: cannot use a dynamic value in call parameter
        print(b.get[i, Int32]())
                    ^

expression failed to parse (no further compiler diagnostics)

无法迭代:

print(i)
error: Expression [71]:19:14: 'Tuple[Int, Int]' does not implement the '__iter__' method
    for i in b:
             ^

expression failed to parse (no further compiler diagnostics)

无法索引:

print(b[0])

错误:

error: Expression [72]:19:12: 'Tuple[Int, Int]' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` methods
    print(b[0])
          ~^

expression failed to parse (no further compiler diagnostics)

With version it gives error when I try to u get an item with an index parameter. But static index parameter works well.mojo 0.5.0 (6e50a738)cannot use a dynamic value in call parameter

This works:

var elements: Tuple[AnyType]
elements.get[0, AnyType]()

but this doesn't

fn __getitem__(self, index: Int) -> AnyType:
    return self.elements.get[index, AnyType]()