Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’ve given up on typing in Python in the work codebase. My colleagues don’t care about types, use meta programming too much (too many type-changing decorators and meta classes, etc), and I’ve seen as much as 2000 false positives per 10k loc.

But even then, when I switched from pyright to ty, I was really amazed at how fast operations like go-to-definition can be. With pyright, the language-server-based go-to-definition is often slower than ripgrep search.

 help



The biggest advantage of my coworkers on a small team fully writing code with AI now is that I can just add whatever guidelines I like to the monorepo AGENTS.md and their code will automatically respect it. I added instructions to write fully typed code and the codebase became much better.

I just spent a week doing a medium sized python project with Claude, and purposefully didn't give it much of a pointer on style out of curiosity. Really very impressed with the code quality, and everything is well typed. I did declare up front to use ty, maybe that nudged it in the direction.

Agents respond _really_ strongly to any feedback mechanisms you put in. Throwing in a typechecker will make them glom onto that - they'll run it constantly as a way to check its work, respect its errors, etc.

Can't apply a technical fix to a social problem. Rigor mismatch, I've found, bus just a personality clash that doesn't get better over time.

I've been in your situation. It's difficult to convince people who have never used static types that it's worth it. Especially in a codebase that didn't use them from the start because it's easily 3x more work to add them after the fact. At least pre-AI. These days you can probably just say "Claude, add type annotations everywhere" and I imagine it would do a pretty perfect job.

Convincing people of static typing who don't care is like explaining color to a blind person

In my experience people will sooner write their Slack posts in Claude than just write up-front what’s going to happen when you run the code.

I’m thinking the reasoning must go something like “Claude writes all my code but at least I can make it write artisanal meta programming to show how clever I am”.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: