Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation Namespace - $var vs '${var}' #36

Open
manykarim opened this issue Oct 27, 2023 · 2 comments
Open

Evaluation Namespace - $var vs '${var}' #36

manykarim opened this issue Oct 27, 2023 · 2 comments

Comments

@manykarim
Copy link
Collaborator

Will you also touch topics like the Evaluation Namespace, e.g. in IF conditions?

e.g. When to use
'${x}' == 'expected'
or
$x == 'expected'

@borutzki
Copy link

I guess that in such expressions the $x == 'expected' syntax should be used, as it preserves types and allows you to strictly use values as such.

Maybe it is not as error-prone as converting everything to str (as is done when using quotation marks) but it forces you to think in advance about types of variables you use, compare and evaluate. Also, it feels more natural (sorry for non-technical description) to use this syntax as $x is anyway evaluated by Python, so it is more straightforward to use python-like object than to convert everything in advance to string and then evaluate.

But of course It’s only an opinion and I’m not even a contributor to this repo at this point. Just found out about it and looked through „Issues” tab.

@guidodemmenie
Copy link
Collaborator

Sounds like a good idea to add this, but it needs some good discussion on what the proper usage would be and what the differences would be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants