Are there problems using special characters in Python codes?

Asked

Viewed 48 times

2

Thinking of leaving the codes more sleek and sleek would it be possible to use special characters in the codes? It would bring some problem?

  • Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site.

1 answer

4


In general, there is no problem, even a PEP that talks about how to do it in the right way: https://www.python.org/dev/peps/pep-0263/.

Of course it doesn’t get you out of trouble because of some external tool that reads the code and isn’t able to handle it, give problem when opening in a bad text editor and other things. This was addressed in general in Is there a problem using Unicode characters for code identifiers?. I would not abuse, I would at most use accents.

Lean and elegant do not always go together (some cases do). I can’t imagine how special characters can make code more elegant and sleek at the same time, yet elegant can be a little subjective.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.