News for hackers. Stuff that matters.
Re:Python’s “type hints” are a bit of a disappointment to me by tonyg on Friday April 22, 2022 @04:54AM (#31119528)
> My stack is pycharm, mypy, pydantic, sqlalchemy stub, several mypy plugins, black, isort, tabNine completion, and a bunch of custom scripts/Make to automate the common tasks.

Christ. What a mess. With a stack like that, it's a stretch to say you're "writing in Python" anymore.

Re:Python’s “type hints” are a bit of a disappointment to me by serial_dev on Friday April 22, 2022 @05:44AM (#31119795)
> Most of their main arguments (...) evaporate as soon as you start using the correct tooling.

You silly! Just use these carefully curated list of 28 different tools (that I got to after years of trial and error) and you'll have a somewhat acceptable tooling and type support in Python.

Re:Python’s “type hints” are a bit of a disappointment to me by danmur on Friday April 22, 2022 @06:13AM (#31119928)
Anything that can use an LSP server will give you most/all of those benefits. Your favourite editor + LSP, that's the tooling. It's very much worth it.
Re:Python’s “type hints” are a bit of a disappointment to me by Spivak on Friday April 22, 2022 @10:10AM (#31121741)
That list is an editor, a type checker, a package to enforce type checks at runtime, 3rd party type annotations for a popular SQL ORM, some plugins for the type checker (probably the pydantic one), a code formatter, an import sorter, and (optionally) a Github co-pilot alternative.
Re:Python’s “type hints” are a bit of a disappointment to me by avianlyric on Friday April 22, 2022 @06:11AM (#31119912)
To be fair, I don’t think you need that entire stack. Just using VSCode + pyright (which is a one button install in VSCode) + type stubs for libraries your using without native hints, gets you 99% of the benefits.

If you really want, you can even throw in a little pre-commit hit hook that runs pyright and prevents you from commuting code with type errors.

Re:Python’s “type hints” are a bit of a disappointment to me by nerdponx on Friday April 22, 2022 @09:29AM (#31121309)
That's such a disingenuous argument.

First of all, Black and Isort are literally code formatters that have nothing to do with type hints.

Second, the whole point is that you can actually develop powerful dev tooling for Python now, whereas in the past it was difficult or impossible.

Re:Python’s “type hints” are a bit of a disappointment to me by john-radio on Friday April 22, 2022 @10:05AM (#31121669)
I think the person you're responding to is just trying to be thorough in case it is helpful to someone else setting up python tooling; the only parts of what they wrote that are relevant to type checking are mypy and pydantic.
Re:Python’s “type hints” are a bit of a disappointment to me by rstuart4133 on Saturday April 23, 2022 @01:53AM (#31131772)
And pydantic isn't really about type checking either. In fact it says that in the first few lines of the it's docs https://pydantic-docs.helpmanual.io/usage/models/ :

> pydantic is primarily a parsing library, not a validation library. Validation is a means to an end: building a model which conforms to the types and constraints provided.

Anyone whose used Typescript or even strong typed languages knew what to expect from Python + mypy. No surprises there. But pydantic's use of type hinting to create a remarkably dense serialisation library, and then fastapi's leveraging that to create REST interfaces along with automagic documentation generation - well that wasn't when I was thinking would happen when I saw the type hinting proposal.

Re:Python’s “type hints” are a bit of a disappointment to me by ramraj07 on Friday April 22, 2022 @06:48AM (#31120106)
Wow gatekeeping types out of python are we? Of course the language looks different when typing is enforced, let it evolve.
Re:Python’s “type hints” are a bit of a disappointment to me by kortex on Saturday April 23, 2022 @01:49AM (#31131754)
It's more so "this is my toolchain I use for my own ergonomics, and what you can achieve with the right kit".

Who cares if I'm "writing in python" at all? I'm solving problems. Honestly a good IDE (pycharm or vscode) will give you 80% of the ergonomics.