[Python-ideas] Need feedback about exposing an operator overloading in a module
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Oct 20 23:25:49 CEST 2014
Julien Palard wrote:
> For me, a module should never
> expose an operator overload, because it may lead to
> unpredicted/unnatural/surprising behavior.
Modules don't expose operator overloads, types do.
The idea that different types respond to operators in
different ways is fundamental to Python, and in general
I don't see anything wrong with making use of that.
I do agree it's something that should be used sparingly,
and most of the time a named method is much better.
But I wouldn't say it should *never* be done.
--
Greg
More information about the Python-ideas
mailing list