I am getting into machine learning, and to document my code, I will write LaTeX math versions of my functions, right next to the code in an Jupyter/IPython notebook. The mathematical definitions include many Greek symbols, so I thought that I might as well use the Greek symbols in function and variable names, since that's possible in python. Would this be bad practice?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
It seems a good use case under these assumptions:
Hint: Entering Greek letters in the notebook is simple. Just type the LaTeX math notation and TAB. For example, type:
and then the TAB key to get a π.
This is what the official style guide has to say:
In other words: It would be considered better practice to use ascii-only, if you are targeting a global audience. If the code is only going to be read by your team, it's a matter of preference.
Really, it is a matter of personal opinion. Keep in mind that Unicode character support for variable names is ONLY in Python 3, so make sure that any external libraries support Python 3. Other than that, there isn't a reason to say no.