Are there any problems with using special characters in Python codes?

2

Thinking of making the codes leaner and more elegant would it be possible to use special characters in the codes? Would you get in trouble?

    
asked by anonymous 06.12.2018 / 23:52

1 answer

3

In general, there is no problem, there is even a PEP that talks how to do it correctly: link .

Of course it does not get you out of trouble because of some external tool that reads the code and is not able to handle it, giving trouble when opening in a bad text editor and stuff. This has been generally addressed in Is there any problem in using Unicode characters for handles in code? . I would not abuse, at most I would use accents.

Lean and elegant do not always go together (there are cases that yes). I can not imagine how special characters can make the code look sleeker and leaner at the same time, though elegant can be a bit subjective.

    
07.12.2018 / 00:00