News for hackers. Stuff that matters.
Re:TypeScript 7 by etaweb on Thursday July 09, 2026 @09:26AM (#48845461)
Note that Python supports type annotations in its syntax, but the interpreter will just ignore them as they are meant to be used by external tools such as ruff: https://github.com/astral-sh/ruff

I've had a good experience developing small to medium sized Python programs/scripts using type annotations plus ruff connected to my editor through its LSP (Language Server Protocol). It helps a lot, and I don't like to write Python without it.

You can create types from literal values and use union types, which I feel makes it more pleasant than Go's type system for example.

Re:TypeScript 7 by _flux on Thursday July 09, 2026 @09:44AM (#48845738)
Definitely mypy keeps my sanity in a relatively large Python project I'm working on :). But I don't believe Python actually assigns any meaning to them, and at times mypy and e.g. pyright may disagree on what the types actually are.