M
Modular2y ago
Igor

kwargs

I'm trying to use a Python function that needs kwargs how do you deal with them?
3 Replies
Stole
Stole2y ago
Modular Docs - Mojo🔥 roadmap & sharp edges
A summary of our Mojo plans, including upcoming features and things we need to fix.
Igor
IgorOP2y ago
@Stole I figure out you can do this:
def create_server(
host: str,
port: int,
reuse_port: bool,
) -> socket.socket:
return socket.create_server((host, port), reuse_port=reuse_port)
def create_server(
host: str,
port: int,
reuse_port: bool,
) -> socket.socket:
return socket.create_server((host, port), reuse_port=reuse_port)
so you can call that function and send kwargs to the other function... and it "works"
Stole
Stole2y ago
Ah yeah I guess you could do it in Python. Not the most optimal workaround but oh well that's probably all we have right now

Did you find this page helpful?