Author serhiy.storchaka
Recipients ncoghlan, serhiy.storchaka
Date 2017-04-15.17:27:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za>
In-reply-to
Content
Two new opcodes BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL (added in 3.5 and 3.6) have too long names (26 and 28 characters). This exceeds the width of the opcode names in the dis module (20 characters). Increasing the width of the column will make opcode arguments too distant from opcode names, that will decrease readability. The better solution would be renaming these two opcodes.

They are used for merging iterables and mappings of positional and keyword arguments when used var-positional (*args) and var-keyword (**kwargs) arguments. Maybe new names should reflect this.

>>> dis.dis('f(a, b, *args, x=x, y=y, **kw)')
  1           0 LOAD_NAME                0 (f)
              2 LOAD_NAME                1 (a)
              4 LOAD_NAME                2 (b)
              6 BUILD_TUPLE              2
              8 LOAD_NAME                3 (args)
             10 BUILD_TUPLE_UNPACK_WITH_CALL     2
             12 LOAD_NAME                4 (x)
             14 LOAD_NAME                5 (y)
             16 LOAD_CONST               0 (('x', 'y'))
             18 BUILD_CONST_KEY_MAP      2
             20 LOAD_NAME                6 (kw)
             22 BUILD_MAP_UNPACK_WITH_CALL     2
             24 CALL_FUNCTION_EX         1
             26 RETURN_VALUE
History
Date User Action Args
2017-04-15 17:27:19serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan
2017-04-15 17:27:19serhiy.storchakasetmessageid: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za>
2017-04-15 17:27:19serhiy.storchakalinkissue30076 messages
2017-04-15 17:27:18serhiy.storchakacreate