Skip to content

Return tuple from SequenceParser and OptionalParser #116

@drhagen

Description

@drhagen

Right now, SequenceParser and OptionalParser return Python lists. This was originally done because [] is syntactically easier to work with than (). However, these are not really intended to be mutable sequences. This plays badly with typing, which has no concept of "a list of length 2 containing a string followed by an int", but does have tuple[str, int].

This is a breaking change, though not massively so because, at least for me, the outputs are typically splatted in a dataclass, destructured, concatenated with each other, length-checked, sliced, or indexed, all of which will work unchanged with tuples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions