Zachary Ware added the comment:

The purpose is to make usage of the operator module more readable, particularly 
for some of the more exotic operators.  For instance, I find 
``operator.get_op(">>=")`` to be a lot more obvious about what's going to 
happen than ``operator.irshift``.

Also, I think it is helpful to have available a listing of all the operators 
that Python supports.  If we're going to have such a listing, why not make it a 
mapping of op to function?  And once we have such a mapping, it would be nice 
to have a nice interface to it.

Having this available would make it easy to implement the kind of function that 
Nick mentioned in the python-ideas thread, that takes an operator string 
instead of only a function.

I will admit that the need is not great, and obviously this isn't something 
that someone who needs it couldn't do themselves.  But I think the convenience 
of it makes it at least worth consideration.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18436>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to