Re:The unknown features of Python's `operator` module
by 6gvONxR4sf7o on Sunday August 08, 2021 @04:46PM
(#28109947)
I try that, but it makes tracebacks harder frequently. Adjusting my programming style based on error message availability is a pet peeve of mine.
For instance, I'm writing a library to simulate the behavior of vectors in R, and that means vectorized operators (the operators runs the length of two paired vectors). All you need to do is make a special tuple subclass that maps the operator along another tuple (vector) and returns your vector subclass:
https://github.com/shanedrabing/pyrat/blob/e0049213152f615e4...
Anyways, this is all to say that I love `operator` and try my best not to use lamdbas much anymore (except where they are honestly simpler).