Author Mark.Shannon
Recipients Mark.Shannon, nedbat, rhettinger
Date 2020-12-22.20:46:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608669961.21.0.502202364344.issue42696@roundup.psfhosted.org>
In-reply-to
Content
In what way is it "kludgy"?
There is a mathematical theorem that states that generated code will be imperfect, 
so we will have to live with that :)
https://en.wikipedia.org/wiki/Full_employment_theorem

3.10a produces more efficient bytecode than 3.9.

3.9:

  2           0 LOAD_GLOBAL              0 (range)
              2 LOAD_CONST               1 (10)
              4 CALL_FUNCTION            1
              6 GET_ITER
        >>    8 FOR_ITER                 8 (to 18)
             10 STORE_FAST               0 (i)

  3          12 POP_TOP
             14 JUMP_ABSOLUTE           18
             16 JUMP_ABSOLUTE            8

  4     >>   18 LOAD_CONST               2 (17)
             20 RETURN_VALUE

3.10a:

  2           0 LOAD_GLOBAL              0 (range)
              2 LOAD_CONST               1 (10)
              4 CALL_FUNCTION            1
              6 GET_ITER
              8 FOR_ITER                 8 (to 18)
             10 STORE_FAST               0 (i)

  3          12 POP_TOP

  4          14 LOAD_CONST               2 (17)
             16 RETURN_VALUE
        >>   18 LOAD_CONST               2 (17)
             20 RETURN_VALUE
History
Date User Action Args
2020-12-22 20:46:01Mark.Shannonsetrecipients: + Mark.Shannon, rhettinger, nedbat
2020-12-22 20:46:01Mark.Shannonsetmessageid: <1608669961.21.0.502202364344.issue42696@roundup.psfhosted.org>
2020-12-22 20:46:01Mark.Shannonlinkissue42696 messages
2020-12-22 20:46:01Mark.Shannoncreate