pylatexenc
pylatexenc copied to clipboard
suggestion for simpler/more correct MacroArgs
Right now, macro args are represented as
ParsedMacroArgs(
argspec="{",
argnlist=[...],
)
where len(argspec) == len(argnlist)
. My suggestion would be to slightly alter this structure to
[
MacroArg(
argspec="[",
arg=#...
),
MacroArg(
argspec="{",
arg=#...
),
]
This has the advantage that illegal state are irrepresentable (len(argspec) == len(argnlist)
is implicit).