k98kurz / autodox

Tool for generating documentation automatically from code annotations, types, and docstrings.
Other
2 stars 0 forks source link

Enhancement: properly parse return annotations with dangling comma, e.g. `-> tuple[int,]` #5

Open k98kurz opened 8 hours ago

k98kurz commented 8 hours ago

Is your feature request related to a problem? Please describe.

Functions with a return annotation including a dangling comma to represent an indeterminate number of elements are not properly documented. For example, def thing() -> tuple[int,] is documented as thing() -> tuple[int], misrepresenting the function as returning only a single value.

Describe the solution you'd like

It should be possible to detect this in the return annotation and document it properly.

Additional context

Happens for both Python 3.10 and 3.11rc1.