News for hackers. Stuff that matters.
Re:The unknown features of Python's `operator` module by klyrs on Sunday August 08, 2021 @06:46PM (#28110903)
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.

There are no comments on this comment yet.