Skip to content

Support type argument syntax PEP 695 (Python 3.12) #19

Closed
@masad-frost

Description

@masad-frost

there's a new type argument syntax for functions and classes

def max[T](args: Iterable[T]) -> T:
    pass

class list[T]:
    def __getitem__(self, index: int, /) -> T:
        pass

    def append(self, element: T) -> None:
        pass

Resources:

See also screenshot in lezer playground by @dralletje, this completely throws off the parser (it thinks it's an array, and it breaks down).

image

I must say I'm impressed by CM+Lezer at how very well everything recovers.

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