Double underscores -- ugly?

Berwyn berhoyt at gmail.com
Mon Feb 18 19:14:32 EST 2008


> Is it just me that thinks "__init__" is rather ugly? Not to mention
> "if __name__ == '__main__': ..."?

That ugliness has long been my biggest bugbear with python, too.  The
__name__ == '__main__' thing is something I always have to look up,
every time I use it, too ... awkward.

I'd settle for:

    hidden def init(self):          # which could be extended to work
for everything "hidden x=3"
    ...

And for __name__ == '__main__' how about:

    if sys.main():
        ...



More information about the Python-list mailing list