Check type of a variable

Hi folks At the moment, while the builtin type function is not implemented yet, What's the best way to identify if a variable is a string, an int or another type?
3 Replies
Ehsan M. Kermani (Modular)
One way is to hover over a variable using LSP help to get more info a variable.
mrlnavi
mrlnavi4mo ago
One question @Ehsan M. Kermani, Will this function be implemented in the future? Is in the roadmap?
Ehsan M. Kermani (Modular)
For Python, we already have py.type, example https://github.com/modularml/devrel-extras/blob/main/tweetorials/py-obj/py.mojo#L14 for Mojo variant LSP is the best solid bet.
GitHub
devrel-extras/tweetorials/py-obj/py.mojo at main · modularml/devrel...
Contains supporting materials for developer relations blog posts, videos, and workshops - modularml/devrel-extras
Want results from more Discord servers?
Add your server