Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Now:
Python 3.11.0a7+ (main, Apr 11 2022, 20:06:08) [MSC v.1931 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> def f():... for i in range(2):... print(i)...>>> __ltrace__ = 1>>> f()-1: 151, 00: 21: 101, 0push <function f at 0x00000256998C2360>2: 166, 03: 171, 0stackadj <function f at 0x00000256998C2360>stackadj <function f at 0x00000256998C2360>-1: 151, 00: 116, 1stackadj <nil>push <class 'range'>1: 100, 1push 27: 166, 18: 171, 1stackadj 2stackadj <class 'range'>push range(0, 2)10: 68push 0pop 017: 116, 3stackadj <nil>push <built-in function print>18: 124, 0push 024: 166, 125: 171, 10stackadj 0stackadj <built-in function print>push None27: 1pop None32: 140, 1833: 93, 17push 1pop 117: 116, 3stackadj <nil>push <built-in function print>18: 124, 0push 124: 166, 125: 171, 11stackadj 1stackadj <built-in function print>push None27: 1pop None32: 140, 1833: 93, 17stackadj <range_iterator object at 0x000002569973F240>16: 100, 0push None34: 83pop None9: 70pop None10: 100, 0push None11: 83pop NoneWhat's possible:
Python 3.11.0a7+ (main, Apr 11 2022, 20:06:08) [MSC v.1931 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> def f():... for i in range(2):... print(i)...>>> __ltrace__ = 1>>> f()Resuming frame for '<module>'[]-1: RESUME 0[]0: PUSH_NULL[<nil>, ]1: LOAD_NAME 0[<nil>, <function f at 0x0000016650F52360>, ]2: PRECALL 0[<nil>, <function f at 0x0000016650F52360>, ]3: CALL 0Resuming frame for 'f' in module '__main__'[]-1: RESUME 0[]0: LOAD_GLOBAL 1[<nil>, <class 'range'>, ]1: LOAD_CONST 1[<nil>, <class 'range'>, 2, ]7: PRECALL 1[<nil>, <class 'range'>, 2, ]8: CALL 1[range(0, 2), ]10: GET_ITER[<range_iterator object at 0x0000016650D3F240>, ]17: LOAD_GLOBAL 3[<range_iterator object at 0x0000016650D3F240>, <nil>, <built-in function print>, ]18: LOAD_FAST 0[<range_iterator object at 0x0000016650D3F240>, <nil>, <built-in function print>, 0, ]24: PRECALL 1[<range_iterator object at 0x0000016650D3F240>, <nil>, <built-in function print>, 0, ]25: CALL 10[<range_iterator object at 0x0000016650D3F240>, None, ]27: POP_TOP[<range_iterator object at 0x0000016650D3F240>, ]32: JUMP_BACKWARD 18[<range_iterator object at 0x0000016650D3F240>, ]33: FOR_ITER 17[<range_iterator object at 0x0000016650D3F240>, ]17: LOAD_GLOBAL 3[<range_iterator object at 0x0000016650D3F240>, <nil>, <built-in function print>, ]18: LOAD_FAST 0[<range_iterator object at 0x0000016650D3F240>, <nil>, <built-in function print>, 1, ]24: PRECALL 1[<range_iterator object at 0x0000016650D3F240>, <nil>, <built-in function print>, 1, ]25: CALL 11[<range_iterator object at 0x0000016650D3F240>, None, ]27: POP_TOP[<range_iterator object at 0x0000016650D3F240>, ]32: JUMP_BACKWARD 18[<range_iterator object at 0x0000016650D3F240>, ]33: FOR_ITER 17[]16: LOAD_CONST 0[None, ]34: RETURN_VALUEResuming frame for '<module>'[None, ]9: PRINT_EXPR[]10: LOAD_CONST 0[None, ]11: RETURN_VALUEThis can make use of the new_PyOpcode_OpName[256] from#91428.