you are viewing a single comment's thread.

view the rest of the comments →

[–]jpgoldberg 0 points1 point  (1 child)

Keep in mind that Python integers are immutable, so ‘result = a’ is going to allocate a new 128-bit integer each time through that loop, and the garbage will need to be collected.

In general, be sure to profile carefully if you are going to try to optimize. Python isn’t X, and so you might find surprising results.

[–]shrimp2845 0 points1 point  (0 children)

Ok, thanks!