An awkward thing about programming in Python: there are lots of double underscores. For example, the standard method names beneath the syntactic sugar have names like __getattr__, constructors are __init__, built-in operators can be overloaded with __add__, and so on. In the Django framework (at least before they integrated the magic-removal branch), the object-relational mapper used keyword arguments named things like user__id__exact.
My problem with the double underscore is that it’s hard to say. How do you pronounce __init__? “underscore underscore init underscore underscore”? “under under init under under”? Just plain “init” seems to leave out something important.
I have a solution: double underscore should be pronounced “dunder”. So __init__ is “dunder init dunder”, or just “dunder init”.
I’ll leave it to someone else to decide what “dunderhead” means now.
Comments
Btw, the name of the paper company on NBC's The Office sitcom is Dunder Mifflin (aka __Mifflin)
Now that we have that cleared up, maybe we can standardized how we should say www: double-u, double-u, double-u, dubya-dubya-dubya, dub-dub-dub, triple-dub, wuh-wuh-wuh.....
I had always hoped that "sextuple-you" would catch on. It's just so suggestive, and less than half the syllables. ;-)
As for the ambiguity of double-scores at one or both ends, how about "dunder foo" for __foo and "dundunder init" for __init__? It's got alliteration and recursion going for it, if nothing else!
> how about "dunder foo" for __foo and "dundunder init" for __init__?
I kinda like "dunder" and, simply, "dundun".
(For www, I'm a huuuge fan of "many-u".)
"private foo" for _foo
"hidden foo" for __foo
"special foo" for __foo__
...or alternatively...
"foo hook" for __foo__
I think its cleaner this way.
Thanks for naming __init __ as 'DUNDER init'.
https://mail.python.org/pipermail/python-list/2002-September/155836.html
Mark Jackson, Thu Sep 26 15:27:16 EDT 2002: And then:
https://mail.python.org/pipermail/python-list/2002-September/157561.html
Tim Hochberg, Thu Sep 26 15:39:14 EDT 2002:
Add a comment: