0

I've got a function that takes a binary function as an argument and does some other things using that function. Is there a built-in way to pass the infix + function as a prefix binary function without making a lambda x,y: x + y, i.e. is there some built-in function that acts like +(1,2) = 3? Same question for -, *, /, and **.

1 Answer 1

1

Ah, it's been like a year at this point, but I stumbled across an answer. All of the infix operations are implemented like normal functions in the operator module. So, for addition you can just refer to operator.add

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.