Skip to content

Make explicit_inversion keyword-only in build_candidates #4

Description

@ddri

`build_candidates(parsed, key_pc, mode, octave, voicing, explicit_inversion)` in `src/banjo/voice_leading.py` takes a positional boolean as its last arg. Boolean positionals are an anti-pattern at call sites: `build_candidates(parsed, key_pc, mode, octave, voicing, True)` is opaque.

Today the only call site uses keyword form, so this is fine in practice — but a one-character change makes it unambiguous forever:

```python
def build_candidates(
parsed, key_pc, mode, octave, voicing, *, explicit_inversion,
) -> list[list[int]]:
```

Flagged in the Task 3 code review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions