Skip to content

Usability of the Python syntax -- field comments #242

Description

When I was writing my Python schema I noticed that I have to use a rather verbose syntax to add comments to a schema:

    x: Annotated[int, Doc("X-coordinate of the top left corner.")]

Looking at the translated TypeScript schema, this gets turned into the much cleaner

    // Top left corner coordinates
    x: number;

I would like to be able to use native Python in-line comments, like this:

    x: int  # X-coordinate of the top left corner.

I think this could be implemented by scanning the source code instead of, or in addition to, passing the schema data structure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions