2 ms·
The operator module is not something most python developers will ever need. It's a collection of very low-level tools that will rarely, if ever, be the right c
by klyrs 5y ago
The operator module is not something most python developers will ever need. It's a collection of very low-level tools that will rarely, if ever, be the right choice in a small code snippet. Can we even talk about the existence of these functions in an easy-to-read blog post, if the only 'right way' to use them is a full-blown DSL parser or whatever? Or, can we trust the reader to not run home and refactor their arithmetic to
#this used to be y = 2 * x + 1 until I read a sweet blog
y = operator.add(1, operator.mul(2, x))
I really don't see any danger of that, myself.