this post was submitted on 12 Feb 2024
18 points (100.0% liked)

Python

6360 readers
9 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

Been 2 months since the update but I don't see any news about code editor support for the new syntax.

This kind of makes sense, i don't expect code editor support to pop up so fast, but i was at least hoping to hear some news about it.

The PEP in question: PEP 695

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 9 months ago (1 children)

I'm not experienced with it, but it looks like Ruff has support?

[–] [email protected] 2 points 9 months ago (1 children)

Good news, On VSCode, with Pylance and Ruff I have both intellisense and new syntax support.

Meh news, symtax highlighting is fucky for generic functions' return type.

Example:

def add[T](a: T, b: T) -> T:
    return a + b

On my setup the -> is colored red but is supposed to be white, that also happens with only the Python extension, so I'm guessing it will be fixed soon.

Besides that, I'm actually surprised this was hidden under my nose as Ruff was already installed, but Pylint and MyPy both started reporting errors which gave the impression that none of my installed extensions support the new syntax. kind of a rookie mistake on my part not to check every extension's website for updates.

Anyway, thanks for the answer, I'm glad to finally be able to utilize this.

[–] [email protected] 1 points 8 months ago

Heard that only pyright, not mypy, has support for the new typing syntax

Wouldn't hurt to try out another static type checker. And if pyright is better. Switch.

Using mypy btw. Haven't moved on to support the new typing syntax

[–] [email protected] 1 points 9 months ago

I haven't checked because Python 3.12 breaks Pytest for us (OOM), so we're sticking with 3.11 for now.