Been working with a codebase that uses Unicode variable names in Python 3. It's great for when I'm reading (policies are named `π` rather than `pi`!), but makes writing and debugging more difficult (kinda difficult to type `π`...). On the whole, pretty worthwhile tradeoff!

Mar 21, 2019 · 12:07 AM UTC

7
71
Replying to @gdb
Have you tried unicodeit? (unicodeit.net) There's a good systemwide plugin for os x. Makes it easy to write Greek letters etc by typing out latex and then hitting a hotkey.
1
11
I haven't! That looks useful, will try it out. Thanks!
1
Replying to @gdb
What is the reason not to change "pi" to "policy", which expresses specific meaning for the variable making it easy to read (even for folks who may be joining without ML/RL experience), easy to write, and easy to debug?
1
2
Replying to @gdb
If you install the packages for Julia language support in any major editor, you can use \pi<tab> (and other LaTeX) regardless of whether you’re actually writing Julia
1
1
Replying to @gdb
:look_of_disapproval:
1
Replying to @gdb
In case you haven't done so already, you could add Greek as a second keyboard language and then just switch between en/gr with the corresponding keyboard shortcut.
Replying to @gdb
What codebase?
Replying to @gdb
On MacOS, π is option+p for what it's worth.
1