artemiogr97
artemiogr97
MModular
Created by a2svior on 5/11/2024 in #questions
Passing a trait as a parameter to `Dict`?
I think you can do the following:
@value
struct RouterMiddleware[HTTPHandlerType: HTTPHandler](Middleware):
var next: Middleware
var routes: Dict[String, HTTPHandlerType]
@value
struct RouterMiddleware[HTTPHandlerType: HTTPHandler](Middleware):
var next: Middleware
var routes: Dict[String, HTTPHandlerType]
4 replies
MModular
Created by raktimbh on 4/25/2024 in #questions
Passing functions to functions.
I think you can pass the function either as a parameter or as an argument
4 replies
MModular
Created by raktimbh on 4/25/2024 in #questions
Passing functions to functions.
4 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
I guess so, and I can tell you that as someone that's been developing in python for a while. I really appreciate having "real" overloads, I no longer have to write def my_fun(arg: Type1| Type2):... and handle everything in one function, I can simply write 2 overloads and treat each case separately, but then again converting from StringLiteral to Optional[String] seem like something that should be doable at some point (I don't necessarily say that would be easy to implement for mojo)
17 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
it's not the same, a Float is Stingable, but I don't want to take floats as inputs
17 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
I was just wandering if it was possible to keep my python code as it was, every argument was Optional[str]=None
17 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
Yep, at the end I found some values that made sense for my case, so I just defined some defaults for everything
17 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
I guess at some point mojo is going to be able to know that is is possible to transform StringLiteralto Optional[String]?
17 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
yeah, I know that i can call String("my_string"), I was just wondering if it was possible to prevent doing that when using Optional, the same way you don't have to call String when the type is simply String
17 replies
MModular
Created by artemiogr97 on 4/14/2024 in #questions
Optional string argument
btw, I would like to have several arguments being optional so defining several overloads could be complicated
17 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
I guess so, let's wait for someone's answer 🙂
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
I guess there is an equivalent environment variable for the "stable" build
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
Basically you have the variable environment variable MODULAR_MOJO_NIGHTLY_IMPORT_PATH in which you can define all your import paths separated by a comma
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
If you are using the nightly build I guess you can do what is mentioned here https://discord.com/channels/1087530497313357884/1226262582629892106
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
True, so I don't know it there is a way to add some path
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
yeah, I'm testing on my side, seems like the -I argument is being ignored
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
The offer option is to set the working dir to be "./foo"
19 replies
MModular
Created by obadakhalili on 4/8/2024 in #questions
Debugging Issue with Mojo's VSCode Debugger
I guess you need to add "." Instead of "..", normally in vscode relative paths are resolved from your working dir
19 replies
MModular
Created by artemiogr97 on 4/4/2024 in #questions
Lifecycle doc clarification
But lines self.size = existing.size and self.data = existing.data are creating copies, are they not ? Shouldn't the move operator also be used in those lines?
5 replies