hpython icon indicating copy to clipboard operation
hpython copied to clipboard

Warn for large constant exponentiations

Open LightAndLight opened this issue 7 years ago • 0 comments

Python will try to constant-fold expressions like 100 ** 123456789, which takes a very long time. Output a warning when this is encountered.

For extra credit, write a refactor rule that will change such occurrences to

a = 123456789
100 ** a

LightAndLight avatar May 08 '18 05:05 LightAndLight