News for hackers. Stuff that matters.
Re:The unknown features of Python's `operator` module by sdrabing on Sunday August 08, 2021 @01:34PM (#28108452)
I've been a weirdo with my Python code recently, and tend towards a more functional programming style. So, the `operator` module is essential for doing some cools things with maps.

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).

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.