Answer the question
In order to leave comments, you need to log in
Why is a+b faster than a.__add__(b)?
>>> from timeit import timeit
>>> timeit('''
... a = 10
... b = 5
... c = a + b
... ''')
0.24442141791507765
>>> timeit('''
... a = 10
... b = 5
... c = a.__add__(b)
... ''')
0.5271954476593237
>>>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question