pout icon indicating copy to clipboard operation
pout copied to clipboard

Can I do anything with the dis module?

Open Jaymon opened this issue 1 year ago • 0 comments

https://docs.python.org/3/library/dis.html

def sum_range(x, y):
    return sum(range(x, y))
>>> dis.dis(sum_range)
  2           0 LOAD_GLOBAL              0 (sum)
              2 LOAD_GLOBAL              1 (range)
              4 LOAD_FAST                0 (x)
              6 LOAD_FAST                1 (y)
              8 CALL_FUNCTION            2
             10 CALL_FUNCTION            1
             12 RETURN_VALUE

via Can python be faster than c++ in future? Any chance!

Jaymon avatar Aug 16 '22 21:08 Jaymon