What does the asterisk in this mojo code mean? fn __init__(inout self, *, capacity: Int):
I'm curious about the source code for List (https://github.com/modularml/mojo/blob/main/stdlib/src/collections/list.mojo#L105C5-L105C47), which has this line
What does the asterisk
*
mean in the function's parameters?GitHub
mojo/stdlib/src/collections/list.mojo at main · modularml/mojo
The Mojo Programming Language. Contribute to modularml/mojo development by creating an account on GitHub.
2 Replies
Congrats @hat, you just advanced to level 1!
Built In
5 Types of Arguments in Python Function Definitions
Learn about the five different types of arguments used in python function definitions: default, keyword, positional, arbitrary positional and arbitrary keyword arguments.