M
Modular9mo ago
hat

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
fn __init__(inout self, *, capacity: Int):
...
fn __init__(inout self, *, capacity: Int):
...
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
ModularBot
ModularBot9mo ago
Congrats @hat, you just advanced to level 1!
Maxim
Maxim9mo ago
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.
Want results from more Discord servers?
Add your server