[Python-ideas] Why operators are useful

Antoine Pitrou solipsis at pitrou.net
Sat Mar 16 06:54:41 EDT 2019


On Fri, 15 Mar 2019 10:51:11 -0700
Guido van Rossum <guido at python.org> wrote:
> Of course, everything comes at a price. You have to learn the operators,
> and you have to learn their properties when applied to different object
> types.

That's not the only price, though.  If "+" is added to dicts, then
we're overloading an already heavily used operator.  It makes reading
code more difficult.  In mathematics, this is not a problem as the
"types" of the "variables" are explicitly given.  Not in (usual) Python.

Regards

Antoine.




More information about the Python-ideas mailing list