Skip to content

Conversation

@FireChickenProductivity
Copy link
Contributor

@FireChickenProductivity FireChickenProductivity commented Jan 8, 2026

examples of using the <user.python_generic_type> capture (spoken form -> result):

list of string -> list[str]

list of string or integer -> list[str | int]

types can be nested with of:

list of optional of integer -> list[Optional[int]]

and can be used for multiple arguments:

tuple of integer and float -> tuple[int, float]

done can be used to exit a nesting:

tuple of optional of integer done string -> tuple[Optional[int], str]

user defined type names are capitalized

list of custom type -> list[CustomType]

saying type first refers to a custom type

type list of type integer -> List[Integer]

I started trying to abstract out the general pattern for implementing generic typing and consent currently refactored some of the Java generic types code.

Typing is different in Python than Java, so the default grammar extends the type, is type, and returns rather than being able to just say the name of a generic type to have it typed out.

@FireChickenProductivity FireChickenProductivity marked this pull request as ready for review January 8, 2026 23:23
@AndreasArvidsson AndreasArvidsson merged commit 2359e4b into talonhub:main Jan 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants