version_target_syntax error

PEP 695 syntax used below the configured target version

type X = ... aliases and class FooT / def fT() type-parameter lists are Python 3.12+ syntax (PEP 695). When the configured python_version targets anything older, the file cannot even be parsed by the target interpreter, so this fires as an error (issue #93).

# python_version = "3.11"
type Alias = int          # E0155 — `type` statement requires 3.12+
class Box[T]: ...         # E0155 — PEP 695 type params require 3.12+
def first[T](x: T) -> T:  # E0155 — PEP 695 type params require 3.12+

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial version_target_syntax down per-file or per-path from your editor or pyproject.toml, or fix the code so it type-checks. See the Type System rules and the complete diagnostic reference.

Canonical URL: https://www.basilisk-python.dev/errors/version_target_syntax