4 ms·
Note that Python is sensitive to indentation not whitespace per se. So long as your line is at the right level there's no difference between a=1+2 and
by gaius 18y ago
Note that Python is sensitive to indentation not whitespace per se. So long as your line is at the right level there's no difference between
a=1+2
and
a = 1 + 2
In fact I wish Python were more sensitive to whitespace, then I could say my-variable without it mistaking a hyphen for a minus.
- rbanffy 18y ago"then I could say my-variable without it mistaking a hyphen for a minus" That's something cool. It would involve a new PEP and aggressive enforcement of PEP 8
- gaius 18y agoReckon it'd break too much existing code, but hyphens are so much nicer than underscores or interCapping. Using a language that supports that, my hands are noticeably more comfortable without needing to reach for the shift key all the time.
- derefr 18y agoyou could just use a font that renders underscores differently (like, say, slightly stylized hyphens.) That's the correct approach, semantically--when you use an underscore, you're basically trying to say "a space, but without the syntactic meaning of one."
- gaius 18y agoIt's not about how it appears on screen but about the keystrokes needed to enter it. If I could I'd find a way to use only square brackets too. Ideally I'd use only ; or : and only ' or " too, and adjust my keymap accordingly.
- nostrademons 18y agoLisp? ;-)
- ericlavigne 18y agoThis is one of the advantages of Lisp. It is common for Lisp programmers to map the [] keys to () and vice-versa. Since Lisp requires so few of the keys, such mappings can prevent you from needing to press the less comfortable keys.
- jacobolus 18y agoIt is not hard to remap your key bindings if you find `_` too hard to type.