Visitar URL original
PEP 695 type parameters are not colored correctly · Issue #6942 · microsoft/pylance-release · GitHub
Skip to content

PEP 695 type parameters are not colored correctly #6942

Closed

Description

Awesome to have syntax highlighting for PEP 695 type aliases. However, type parameter are still missing unfortunately.

Image

from typing import Generic, TypeVar

T = TypeVar("T")

class X(Generic[T]):
    def __init__(self, var: T) -> None: ...


class Y[T]:
    def __init__(self, var: T) -> None: ...

Originally posted by Marc Mueller (@cdce8p) in #5541

Activity

  1. Avasam commented on Jul 27, 2025

    @Avasam
  2. heejaechang commented on Apr 15, 2026

    @heejaechang
    Contributor

    Rechecked this in the current prerelease on a fresh VS Code session using the generated repro workspace, with editor.semanticHighlighting.enabled still set to false.

    The behavior from the original report is no longer reproducing:

    • the T tokens in class Y[T] and def foo[T](...) -> T are colored distinctly again, consistent with the older generic syntax path
    • the -> arrow no longer falls back to the error-like/plain-text styling from the original screenshot

    Given that fresh rerun result, I’m closing this as no longer reproducible in current builds.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions