hpython
hpython copied to clipboard
Warn for large constant exponentiations
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