I read and write all my Python code (and all my code in every language) in a proportional font.
You may be thinking of Python's "significant whitespace". But all that does is indicate nested blocks.
This works exactly the same in a proportional or monospaced font. The only thing Python cares about is how many spaces or tabs you have at the beginning of a line, and that you don't mix the two.
There are coding styles that don't look as good in a proportional font, such as this kind of "column alignment" or "hanging indent":
The latter is a better style anyway. It takes more lines, but it doesn't require realignment when renaming. Not to mention that getting the variable indent alignment can require fighting the editor. One common feature is to delete spaces back to the previous tab stop. When not aligning things, that feature is handy and exactly what I want the editor to do. But for realignment, it's a big pain. Removing a single leading space might require hitting delete and then pressing space 3 times. You might even need to do that when adding spaces because it's easy too overshoot by a single character and have to move backwards to correct it.
Technically, you can use any language, including Python. Python cares about the number of whitespace characters, not the sizing of them. Any other languages will have the same issue of your columns / pretty formatting not lining up exactly, but won't cause any issues.
If I had to pick one to use with a proportional font, I guess it would be Perl. The aesthetics would at least fit it well.
I'd love for all IDEs to support notebook style computing where comment blocks just turn into proportional font prose, perhaps with optional markdown rich text. Tables, lists, etc. look way better as proper HTML instead of ASCII art intermingled with code.
I’ve used Input Sans[1] with Python in the past and it works pretty well except if you use white space for formatting or ascii art as opposed to just indenting.
It works because the spaces are nice and wide unlike in a typical proportional font.
I don’t use it anymore mostly because I wanted something with a little more character but it’s worth a try.
You may be thinking of Python's "significant whitespace". But all that does is indicate nested blocks.
This works exactly the same in a proportional or monospaced font. The only thing Python cares about is how many spaces or tabs you have at the beginning of a line, and that you don't mix the two.
There are coding styles that don't look as good in a proportional font, such as this kind of "column alignment" or "hanging indent":
But you don't have to code like that!The most popular Python code formatter, Black, only uses indentation and no column alignment. Here is how it formats that code:
This indentation-based coding style is just as easy to read and write in a proportional font as it is in monospaced.https://black.readthedocs.io/en/stable/