Python is chock-full of identifiers beginning and ending with double
underscores, such as __builtin__, __contains__, and __coerce__.

Using underscores to signal that an identifier is somehow "private"
to an implementation is pretty common in languages other than
Python.  But in these cases the understanding is that the use of
these variables in external code amounts to "going behind the API",
and is therefore unwise.

But as far as I can tell, Python's double-underscore variables are
very much part of Python's API.  E.g., programmers are specifically
instructed to override "double-underscore methods" to achieve
certain functionalities.

In this case, I wonder: what justifiies the double-underscore
convention?  For example, what would be the problem with changing
the name of the complex.__gt__ method to complex.gt?

TIA!

kynn
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to