Y
Hacker News
new
|
ask
|
show
|
jobs
by
gakada
3568 days ago
I don't get what you're saying. How is it possible to write code without string literals?
subprocess.check_call([ "/usr/bin/env", "echo" "hello world" ])
2 comments
nitely
3568 days ago
I think she meant to not pass the strings but assign them to constants and then pass those.
link
bpicolo
3568 days ago
Yep! But, like I mentioned, linter can catch this too.
link
ves
3568 days ago
he probably meant not using string literals / ints outside of top-level declarations, so you would instead assign all these parameters to "constants" at top level and then use those constants in function calls, hence avoiding this error.
link