Is there any way in Python to get the addition object (operator +) for integers in Python and store it somewhere?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can also use
operator.addto obtain a generic function for adding in Python:If you want to get the addition method of a specific integer, instead of the
inttype, see gnibbler’s comment on the question:An example: