This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author uriyyo
Recipients uriyyo
Date 2020-12-03.20:38:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
`dis` module failed when trying to parse function that has only annotations at the function body:
def foo():
    a: int

Failed with stacktrace:
  1           0 LOAD_CONST               0 (<code object foo at 0x10847ebe0, file "", line 1>)
              2 LOAD_CONST               1 ('foo')
              4 MAKE_FUNCTION            0
              6 STORE_NAME               0 (foo)
              8 LOAD_CONST               2 (None)
             10 RETURN_VALUE

Disassembly of <code object foo at 0x10847ebe0, file "", line 1>:
Traceback (most recent call last):
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 536, in <module>
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 533, in _test
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 79, in dis
    _disassemble_recursive(x, file=file, depth=depth)
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 381, in _disassemble_recursive
    _disassemble_recursive(x, file=file, depth=depth)
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 373, in _disassemble_recursive
    disassemble(co, file=file)
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 369, in disassemble
    _disassemble_bytes(co.co_code, lasti, co.co_varnames, co.co_names,
  File "/Users/yuriikarabas/my-projects/temp-cpython/Lib/", line 389, in _disassemble_bytes
    maxlineno = max(linestarts.values()) + line_offset
ValueError: max() arg is an empty sequence
Date User Action Args
2020-12-03 20:38:17uriyyosetrecipients: + uriyyo
2020-12-03 20:38:17uriyyosetmessageid: <>
2020-12-03 20:38:17uriyyolinkissue42562 messages
2020-12-03 20:38:17uriyyocreate