Replies: 2 comments 5 replies
-
Honestly, I think unicode for representing variables in code is a royal pain and should be avoided. It's a lot easier for me to write >>> beta
>>> # versus
>>> β in docstrings. However, when it comes to writing core documentation I have no problem with using unicode. For example, out of respect, I prefer to write |
Beta Was this translation helpful? Give feedback.
-
Oh...and when we're using Jupyter notebooks or ipython, we can type |
Beta Was this translation helpful? Give feedback.
-
Python 3 has gone full unicode, and it's valid to use a wide range of alphanumeric unicode characters in object names:
Typing in unicode characters is kind of a pain. Well, a big pain...unless you're like me and memorize the unicode characters for en dashes (–,
U+2013
), em dashes (—,U+2014
), and ń (U+0144
) because I got tired of having to copy and paste them. So, we don't want to have unicode characters in the names of functions or arguments that users would have to interface with.But using unicode characters for standard plasma symbols internally could at times make our code a lot more readable, in particular for code that is read a lot more times than it is written. If we have a variable named
beta
, it would likely be more readable to useβ
instead.The best option for variable names is often to use the name of the concept, but this can lead to really long and messy equations that are difficult to check against the original source. When we have complicated equations, using unicode characters would probably clean things up...especially if we copy an equation verbatim from the original text.
Beta Was this translation helpful? Give feedback.
All reactions