In what situation should the built-in 'operator' module be used in python?

Posted by apphacker on Stack Overflow See other posts from Stack Overflow or by apphacker
Published on 2009-01-22T03:03:46Z Indexed on 2010/04/07 22:43 UTC
Read the original article Hit count: 254

Filed under:
|
|

I'm speaking of this module: http://docs.python.org/library/operator.html

From the article:

The operator module exports a set of functions implemented in C corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. The function names are those used for special class methods; variants without leading and trailing __ are also provided for convenience.

I'm not sure I understand the benefit or purpose of this module.

© Stack Overflow or respective owner

Related posts about python

Related posts about operator-module