Closed DanielRosenwasser closed 4 months ago
This change adds support for translating tuple types in Python.
A fixed-length tuple is translated to a corresponding array-backed tuple in a TypeScript schema.
target_type = [int, str] # is `[number, string]` in TS target_type = [int] # is `[number]` in TS target_type = [()] # is `[]`, the empty tuple, in TS
An unbounded homogeneous tuple is simply translated into an array.
target_type = [int, ...] # is 'number[]' in TS
Any unsupported form is typically translated into any[].
any[]
This change adds support for translating tuple types in Python.
A fixed-length tuple is translated to a corresponding array-backed tuple in a TypeScript schema.
An unbounded homogeneous tuple is simply translated into an array.
Any unsupported form is typically translated into
any[]
.