Whole file

ilevkivskyi/com2ann

The author described this change as Fix signature wrapping when return type contains commas (#21). It counts as a record because the check below fails on the code as it stood at bb8a37fa4 and passes on 46505e6bb, with nothing else changed between the two runs.

Fix saved2019-06-12
Sharing licenceMIT · LICENSE
Change size+4 1

What the code was meant to do, written into the code itself as a save note

Fix signature wrapping when return type contains commas (#21)

The change

459459 parts: List[str] = []
460460 next_part = ''
461461 nested = 0
462+ complete = False # Did we split all the arguments inside (...)?
462463 indent: Optional[int] = None
463464
464465 for i, c in enumerate(header):
468469 indent = i + 1
469470 if c in ')]}':
470471 nested -= 1
471- if c == ',' and nested == 1:
472+ if not nested:
473+ complete = True
474+ if c == ',' and nested == 1 and not complete:
472475 next_part += c
473476 parts.append(next_part)
474477 next_part = ''

The check that tells the two apart

failpass·src/test_com2ann.py::FunctionTestCase::test_wrap_lines

Check file src/test_com2ann.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itbb8a37fa473060623ff4589b3cf3f4ebf4f1eb09
Broken version dated2019-06-11
Modulecom2ann
Units changedwrap_function_header
Fingerprintf3a14109e961132c
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in ilevkivskyi/com2ann