Python is great, but __

I haven’t used Python a lot, but from what I know about it, I consider it one of the good languages. A bonus is that most Python programmers seem pragmatic and humble, which is nice compared to the impression of Ruby community left by some of the more arrogant Ruby folks. But there’s one thing that really irks me about the language, more than the somewhat significant whitespace or some of the syntax quirks:

__init__

What the fuck is up with that? I have seen very few pieces of Python code which didn’t contain those double underscores. How was it decided that commonly used names will contain four underscore characters? I doubt that names such as init, main, iter, etc. were considered so precious that the language must not treat them specially. Perhaps in the early days it wasn’t apparent that the magic methods would be used as often as they are? Or maybe it was but the __ didn’t bother enough people? I would find that strange, but then again people get used to everything. Scala makes magic use of the underscore as well, but I’ve gotten used to the few cases where it’s part of names. Most of the time it’s used as a wildcard, and that doesn’t bother me at all.

Do you program in Python regularly? What do you think about the underscores?

Advertisements