How does mypy score so low? Isn't it the reference implementation?
LoganDark 13 hours ago [-]
mypy existed before the spec and still remains relatively compatible with older versions of itself.
IshKebab 8 hours ago [-]
Mypy is pretty jank. It's very old, written before most of the type hinting features were decided, and the quality of the codebase is overall quite low (probably doesn't help that unlike the others it's written in Python).
globular-toast 12 hours ago [-]
I'm not sure how meaningful this conformance suite is given that ty doesn't properly handle `finally` but I can't see that on there.
cataflam 4 hours ago [-]
I honestly don't know, but the conformance suite is only part of the story to decide for sure.
zelphirkalt 2 hours ago [-]
I used Zuban not too long ago. Maybe 2-3 months ago. It kiiinda works, but many times I couldn't properly refactor rename enum members and expect them to be changed everywhere, or had some crashes/panics etc. Ultimately, I switched to Ty, as the next tool in the line of tools I was willing to try, and I am now quite happy with it. Zuban at 100%? Sounds sus, but maybe can be correct, when one doesn't value some other aspects. Maybe one day I will switch back to it and try it again. Lets see, whether it survives until then, since it is also kind of a one-man show/bus factor of 1.
cataflam 22 minutes ago [-]
Interesting feedback on usage, thanks
As far as I can tell:
- pyrefly -> Meta
- pyright -> Microsoft
- ty -> OpenAI
- zuban -> 1 courageous person
Can be both a good and a bad thing
adsharma 23 hours ago [-]
All the people asking for django type checking: there is no free lunch. You have to change how you write Django to be type friendly. Applies to sqlalchemy/sqlmodel too.
It doesn't cover querysets, but it covers most of the model attributes automatically. It's not 100% perfect but it's way better than nothing and it allows you to check a lot of things ty and pyright.
rtpg 20 hours ago [-]
Your premise is not true IMO, you can totally get "correct" type checking on fields (including things like "write a string to a field, but normalize to an int and get int, things that Pydantic do not give you!)
I beg everyone thinking of writing an ORM or a validation framework to look at my gist and internalize it. You don't need top-level type annotations to get type checking form mypy and friends!
People's first idea when trying to tackle types in Python is "OK I want this field to be an int so I will have an API that labels it an int" but if you lean into descriptors you will get a much more flexible system that can handle more scenarios.
Being able to distinguish "types that can be written to a field" from "types that are read from a field" in particular are _so straightforward_ all things considered.
This doesn't solve a lot of the reverse relation issues and annotations on querysets but neither does your library.
adsharma 20 hours ago [-]
There is no formal system backing up this style of typing. I'm also of the opinion that any such type enhancements have to be friendly towards machine translation to Rust.
I maintain one such transpiler.
Dependent types that can be machine translated to lean4 proposed here. Google static python skill.
> There is no formal system backing up this style of typing
This is not true. Python's typing system is based on two typing formalisms that are well studied in the academic literature: set-theoretic typing and gradual typing. We've drawn a lot of inspiration in particular from the work done by Giuseppe Castagna and his collaborators.
Elixir's type system is based on exactly the same formalisms, and our teams have met several times to share notes on the underlying concepts, and on implementation techniques. Guillaume Duboc's PhD thesis, which he defended earlier this year, is a particularly strong example of this; we were able to implement an incredibly effective optimization [1] based on his work optimizing disjunctive types in Elixir's type checker.
Now, it's definitely true that Python is a very complex language, and so its type system does not (and cannot) implement the academic set-theoretic algorithms directly. But it provides exactly the formalism that we need to reason about the kinds of code that appears in real-world Python programs.
> Now, it's definitely true that Python is a very complex language
If you're trying to make things better for python as it stands now, this is a reasonable path to take.
But there are alternatives. Like the one py2many is pursuing. We seek to build a language that's syntactically similar to CPython, but has a type system similar to ML derived languages.
(And to connect it upthread, intersection types let you implement a form of row polymorphism [2], which give you some of the pieces that you need to model these more complex django examples. Not all of it is connected yet to constructs that are available e.g. in the `typing` module, but the underlying formalisms are sound.)
I do hope that we can get all the pieces together and be able to really express everything without plugins or special casing in the code. I think we're close!
I do want to have better ergonomics for the type-level programming overall. Typescript is a relative joy to work on (still a pain), but even just some simple "attribute mapping" mechanisms would be cool
rtpg 19 hours ago [-]
> There is no formal system backing up this style of typing.
I mean just abstractly speaking you can define semantics on a typing relation that behaves this specific way based on a class definition. You have to futz around a bit to distinguish writes from reads, but it's "just" busywork IMO. I don't believe there's some semantic difficulties there. Subtyping issues are way worse than this, at first blush (ready to be told otherwise though!)
> I'm also of the opinion that any such type enhancements have to be friendly towards machine translation to Rust.
I mean that's your opinion. I have nothing against Rust and use it but my objective in using Python is to use Python.
adsharma 16 hours ago [-]
> my objective in using Python is to use Python.
The rate at which people are rewriting python in Rust, there will be very little left.
My goal for the last 5 yrs has been to make sure they don't do it manually.
Much of the resistance I run into is because of exactly this sentiment, which I think will be overcome because of market and technological pressures.
I also believe that a smaller subset of python is more amenable to formal verification some of it via the type system vs something like Verus/Rust.
kevsamuel 13 hours ago [-]
PEP 681 is taking care of that.
Despite the name containing dataclass, it can work for Django.
Nice. The main difference in thinking is that existing python ORMs use implementation inheritance (Model/BaseModel).
I've argued with pydantic, sqlmodel and Django people that they should replace them with decorators instead.
This will primarily help with automatic translation to Rust.
memco 1 days ago [-]
I'm excited for this as I think Ty is quite nice to use, but this announcement was hard to appreciate because it feels poorly written.
They have benchmark graphs which aren't properly labeled; the links (when they exist below) do not give a more full picture (you just have to jump back and forth and try to map the table to the graphs somehow?); and the year-over-year growth chart feels weird. The YoY chart makes me want to know more about why mypy grew 4x from 2025 to 2026 than it makes me feel like Ty has healthy growth. It also is concerning why they chose to emphasize growth of the user base over the actual type checking advantages that Ty gives: especially the advancements 1.0 gives.
It's a mishmash of information and feels lacking.
zanie 1 days ago [-]
Regarding mypy growth, overall downloads of packages from PyPI has increased ~5x in the last 2 years, which explains part of the change, but it appears usage of type checkers is growing faster than that, which is an interesting trend.
A healthy ecosystem around a tool is important, especially a type checker since you want library authors to prioritize a good experience for your tool of choice. It is noteworthy here that ty adoption has grown significantly beyond the rates of other tools.
flatline 23 hours ago [-]
Everyone coming from statically typed languages trying to build full-blown applications using Python pretty quickly figures out how to get static type checking in Python.
`mypy` has caught missed pieces of refactors that were simply never checked anywhere else. It’s found confusing type declarations and outright logic errors, way more than I thought it would in an otherwise well-structured and heavily annotated code base.
masklinn 11 hours ago [-]
A codebase which is heavily annotated but not checked is not going to do much, it has some documentary value but that only goes so far, and in my experience editors will pretty quickly fallback to Any if they do anything at all.
alexwaygood 7 hours ago [-]
I'd honestly argue that an annotated-but-unchecked codebase has negative documentary value -- it's so, so easy for the annotations to be incorrect or out-of-date if they're not checked in CI. So they often end up just being misleading and confusing
masklinn 5 hours ago [-]
They do indicate intent, which can be useful. If possible I’d rather have that than docstring fields as it’s a start and the structure makes it easier to process and / or hide. For simple types anyway.
But if you start writing complex unions or typed dicts and nothing’s checked then yeah.
zanie 1 days ago [-]
What's wrong with the labels on the benchmarks specifically?
(I am on the team and can look into improving them if something can be clearer)
Curious to see how Ty now compares to Pyrefly in practice. Had to switch from Ty because it was rather poor compared to Pyrefly at the time. A bit spoiled for choice in regards to Python type checkers now.
ibejoeb 1 days ago [-]
Hah. I just switched from Ty to Pyrefly last night. Like 15 hours ago. I guess it was a good exercise, but now I want to compare this release.
_carljm 1 days ago [-]
Would be happy to know where we could do better, if you do this comparison on your codebase today. GH issues are open!
eyegor 15 hours ago [-]
For a long time, ty fell back to Any and `x | Unknown` all over every code base I tried, especially for non type hinted functions and attributes, even when they had constrained types, which just propagates into noise and bad hints all over. Ty also doesn't respect any forms of """ comment docs as far as I can tell, so you lose all attempts to attach documentation to function args. Mypy, pylance, and pyrefly (when turned up) all handle these gracefully.
alexwaygood 7 hours ago [-]
We used to add `| Unknown` unions to a lot of attribute types. We've since changed our behaviour so that we now basically never do that (there are still one or two rare exceptions). So I'd love it if you could give us another chance there!
We should also support attribute docstrings everywhere now.
1 days ago [-]
fukaiall 21 hours ago [-]
I did exactly the same thing. Nothing against the performance but too much errors in my VS code IDE. But it was 0.xx at that time and I am not sure whether situation has got any better in 1.0
NostraDavid 1 days ago [-]
> at the time
Any indication of when that was? Just being curious.
wiseowise 1 days ago [-]
I’ve tried it in Spring of 2026. Pyrefly + its VSCode extension just worked, while ty either straight up didn’t work at all or caught nothing.
Balinares 13 hours ago [-]
Then it's definitely come a long way. It works just fine now.
fishgoesblub 22 hours ago [-]
I think I switched to Pyrefly in very early 2026? I can't remember.
tasuki 22 hours ago [-]
> A bit spoiled for choice in regards to Python type checkers now.
"Spoiled" is not the word I'd use. In my admittedly brief experience all the Python type checkers are terrible in practice, and the problem is Python. You know in which languages type checkers work? Elm, Gleam, Haskell, etc. There's usually one type checker and it works – there's no need to create several competing-but-all-broken-in-various-ways type checkers.
Those are pretty out of date, esp the comparison post - a lot of development has happened in the last year and a half.
kccqzy 1 days ago [-]
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.
flexagoon 21 hours ago [-]
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.
rkangel 12 hours ago [-]
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.
mrsilencedogood 5 hours ago [-]
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.
quotemstr 1 days ago [-]
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.
IshKebab 22 hours ago [-]
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.
ripharamberip 17 hours ago [-]
Convincing people of static typing who don't care is like explaining color to a blind person
kamalmosadegh69 5 hours ago [-]
[dead]
refactor_master 21 hours ago [-]
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”.
natsu529 1 days ago [-]
Congrats on 1.0, this looks really interesting and I'd like to try it. Does ty have any story for Django / DRF yet? I rely on django-stubs and its mypy plugin for models and querysets, so I'm curious how ty handles that kind of dynamic behavior.
Oh nice, didn't know that, thanks! Does it handle DRF too, or just Django itself? Haven't had a chance to read the docs yet.
alexwaygood 1 days ago [-]
I don't think we have any special handling of DRF (yet). It would be good to know exactly what you need there! Feel free to file an issue on GitHub :-)
natsu529 1 days ago [-]
Thanks for the quick answer! I'll write up what I'd need for DRF and open an issue.
quotemstr 1 days ago [-]
Why should the type checker have to know anything about Django? What if I want to make a framework with the same shape? Do I submit a PR to Ty? One that I bet would be rejected because I didn't have any users yet? Users who won't come without type checking support?
This style of development is unfair to innovators and ossifies the ecosystem.
dcreager 1 days ago [-]
Ideally it shouldn't; I don't think anyone would argue otherwise.
But (1) django is older than Python's type system, so it uses some very dynamic patterns that are hard to express using Python types. And (2) it's very popular, which means both that lots of people want their type checker to do Something Useful™ with django code, and that it would be very difficult to retrofit django to use dynamic patterns that _are_ more compatible with the type system. That combination makes it worth our time to add specific custom support for it.
For your own future library, the hope is that the type system has become capable enough that you wouldn't _need_ custom type checker support. Things like `dataclass_transform` [1] were added specifically so that _all_ libraries could express these kinds of things in ways that are visible to the type checkers without custom support.
If you're doing something that still doesn't fit into what the typing system provides, then the Python typing community wants to learn about your use case so that we can see if we can extend the typing system even further to support it.
Django doesn't really do any too crazy. Most use cases would be filled if there were a way to declare:
- Adding field X also adds field x_pk
- Adding field X also changes the signature of function Y to accept parameter x, x__lt, x__gt, etc.
- Adding field X lets you do a.x = 5, even though X is not really an integer
As an aside, I have to give it to the Typescript team for taking Javascript which was fundamentally as metaprogramming happy as Python, and creating a type system that matched it. Having a goal that every popular pattern in Javascript should be type-checked was a great starting choice, because they couldn't simply copy some other languages' static typing methadology and had to work from teh ground up.
zbentley 19 hours ago [-]
There is a lot more than that. Reverse FKs, chained relations (foo__foofk__barfk__in), complexity regarding Django's several understandings of "abstract"/interfaces/protocols (abstract models, form classes that implicitly can or must provide methods with specific names/signatures depending on what fields are on the form, etc.), runtime-generated model classes (how and where to check in or tell the typechecker about those stubs?), lazy objects that change type (gaining and removing/changing behavior) at runtime based on things that are pretty hard for a type checker to notice, like random field access/indexing, and so on.
And that's just the core Django dynamism; the stuff that needs to work really well. Not even getting into stuff that would be nice, like custom managers providing methods to model instances, Q/F type helpers, any sort of typing help with templates (even just "can this method be called with the signature this template wants"), complex model introspection typing, something cleaner than pydantic/manual TypedDicts for form data at the ser/de boundary, and so on.
Even that bare minimum requires some pretty difficult features, type-checker wise: extremely distant dependent types ("if field X exists, method Y should take kwargs X__in and so on" as in your example, as well as "if field X exists, method get_X must be declared on class Y with signature Z", and "if field X exists, then a very distant method in a model manager needs to be documented to return type Y if values_list=True"), very robust support for runtime-created signatures that in a lot of Django systems cannot be generated and checked in (e.g. database-derived models or JSON-backed fields outside of Postgres), extremely complex dependent typing in classes whose generic bounds are determined pretty late/at mixin time (but which may also conceptually be mixins that can only be used in a very few appropriate cases), and more.
Like, just think about model field names in manager method arguments--a tiny fraction of the problem. All the different chained/related kwargs would have to be computed and typed, as well as their disjoint: if I rename field "foo" to "bar", and forget to update some caller that does "m.objects.filter(thing__thing2_fk__foo__in=[1,2])", it'd be great if the type checker could help me catch that. But even if it can't, does that mean that "objects.filter" has all-optional typed kwargs and also takes **kwargs as well, because the type coverage is gradual? As soon as that's allowed, a whole lot of useful typechecking abilities go out the window since misnamed keys can just fall into the wildcard. Solvable, sure, but a major pain in the ass to implement--especially given that Django is a fast-moving target adding/removing/changing functionality all the time.
Again, that's just Django basics. Things that ordinary, bog-standard, not-using-advanced-functionality Django code needs all the time. If the typechecker mishandles one of those cases and makes life harder, people will abandon it. There's a very tricky line to walk here re: when to be strict and when to give up on typechecking entirely, but Django has a lot of places where the latter is necessary.
quotemstr 1 days ago [-]
The Python typing community has known about the expressiveness problems for years. It's forward-only, has no HKTs, no type computation, no complement. I can't even do generic parameter list transforms.
All of these are known deficiencies. Everyone who brings them up is told to pound sand, their use cases deemed illegitimate. Might as well be GNOME.
It's fundamentally unfair that Django gets to use aspects of the language other tools can't, and one hard coded dataclass-style transform is inadequate.
So help me God, if I ever do another large scale Python project, then if these issues aren't fixed in typing, I will vendor and modify a type checker in the project itself and teach it my project's patterns directly. I will not twist and distort my design vision so it rhymes with dataclass.
zbentley 19 hours ago [-]
> It's fundamentally unfair that Django gets to use aspects of the language other tools can't
You can just ... not typecheck parts of your code. All of these tools are gradual, since Python's much too dynamic to encompass everything. Falling back to runtime "I know how this works" dynamism isn't a sin, it just requires a little care. Add restrictions (typed wrappers, verbosity/limitations a la dataclass_transform) at the boundaries where people make frequent mistakes, and move on with your life.
_carljm 1 days ago [-]
I agree; we don't like this either. But there is no palatable short-term alternative. If we don't do it, then Django/pydantic/attrs users will just prefer other type checkers that do. The best long-term option is to make all of this expressible in the type system; there are proposals currently under consideration that will go a long way towards this.
Plugins do provide a more level playing field, and we aren't closed to the possibility of supporting them in future. But they come with a whole host of challenging technical problems, and we have a lot of other high-priority things to work on.
quotemstr 1 days ago [-]
These proposals have stalled behind consensus hell for years. Enabling plugins would be a pragmatic option: you could even spell them as HKTs or something right in the source. Or you could enable private type system extensions.
goodoldneon 1 days ago [-]
I'm not sure about Django + Ty specifically, but some dependencies need a plugin because they're impossible to type annotate otherwise. For example, sqlalchemy + mypy
quotemstr 1 days ago [-]
Exactly. Why are we baking support for this or that package to the core instead of enabling plugins or just making the type system more expressive?
It takes a great effort and time to push things like PEP747 forward and when you manage, perhaps you need to wait several years until the lowest supported version of python implements the changes you wanted.
alex7888 1 days ago [-]
[dead]
LtWorf 22 hours ago [-]
pydantic needed the mypy plugin from the beginning because their types meant something different than the python semantics. For example pydantic allowed "a: int = None" which is an error for mypy.
computerfriend 8 hours ago [-]
This is allowed by mypy if the implicit_optional option is set.
We switched from Pyright to Ty during early betas and never looked back. The speed was a clear win, and the few bugs we hit were all resolved. Great work Astral folks.
wilkystyle 1 days ago [-]
Congrats to the Astral team! I've been using ty since the alpha days. Was so excited to replace pylsp with it, and it's been a mainstay in my arsenal ever since. It's gotten so reliable over the past year or so that I forgot it was pre-1.0 software.
chaz6 1 days ago [-]
Something to note: Ty does not search for modules in the same places that CPython does by default. It will not find modules installed at ~/.local/lib/python{version}/site-packages/. They insist that you use a venv.
_carljm 24 hours ago [-]
Hi! ty doesn't insist on venv usage; we already support discovering packages from non-venv system Pythons. It looks like `~/.local` was just an oversight; as far as I can see no user reported it yet. Working on a PR to add this support.
satya71 23 hours ago [-]
If you want Django coverage, pyrefly is much better. I also liked pyrefly because their type inference was more conservative. Though ty lists one place where it seems ty is more conservative?
alexwaygood 1 days ago [-]
> They insist that you use a venv
Hmm, that's not accurate anymore! We look for your Python installation in a number of places these days -- we should discover system installations on PATH, conda installations, pixi installations, and, yes, local virtual environments. Is your Python installation at `~/.local` on PATH?
alexwaygood 23 hours ago [-]
(sorry, I forgot how local installations work -- of course they are not on PATH. My colleague mentioned above that this is indeed a specific place we don't yet look for installs. My broader point remains that we certainly don't require virtual environments, however.)
chaz6 11 hours ago [-]
I was remembering an old report from uv requesting the pip equivalent of --user and being told that it would never support it.
That is where I looked, and it does not include ~/.local/lib which is where `pip install --user` installs to by default.
Otterly99 8 hours ago [-]
I tried it on my project and it does run faster than mypy (0.8s vs 2s). However, it seems to be lacking the "--strict" behavior of mypy, which in my opinion makes it a weaker option for a trivial speed gain.
dcreager 7 hours ago [-]
We cover this a bit in one of the sections of our mypy migration guide [1]. The short version is that many of our equivalents of mypy's `--strict` checks are enabled by default; the ones that aren't are for a purposeful reason, but you can manually enable them if you want; and some are covered by ruff lint rules, not ty type-checking rules.
Congrats! This is a huge milestone. Out of curiosity, what will it take to get Ruff and UV to 1.0.0?
woodruffw 1 days ago [-]
Watch this space :-)
microflash 17 hours ago [-]
Excellent. Introduced ty at work earlier this year and many teams have been using it with great success on small and medium size projects. Will be trying out 1.0 soon.
WD-42 1 days ago [-]
Congrats to the Ty team. Been using it for a while now.
Funnily though I’ve started to care less about typing in Python. Since Rust got good most projects where I’d want strong types I’m not using Python anymore. Python is still great for glue code, as it was intended. Typing helps there if libraries have good support but I find myself writing Python type annotations less now. It’s always been a bit awkward and ugly in Python anyway.
user-error 15 hours ago [-]
Been using ty since alpha. Definitely fast as advertised but still some functionality missing. Curious to discover if the 1.0 release has filled the gaps.
Python's typing system has really matured and with 3.14 most of the ergonomic issues have been ironed out. Between that and AI coding there's no good reason not to have strict type checking on your python code. But mypy is simply too slow to use in practice though so it'll be between ty and pyrefly I guess.
dkmar 22 hours ago [-]
Can any of the LSPs give type info for tensor methods in pytorch? It has always surprised me that we dont get transcluded documentation for those from their static function counterparts (usually it just says like `See :func: torch.permute` if i hover over `x.permute`)
I love this… but. My most frequent editor these days is one that only lets me configure one language server per open file, so today I have to choose between a linter or a type checker, but not both at once. I do so which this were a ruff plugin or vice versa.
By the author of Emacs builtin LSP server (eglot), but completely generic.
kstrauser 20 hours ago [-]
I'm using that now (with BBEdit) and it's overall alright, but it'd still be nicer and easier to deploy and configure if they were besties.
jason_s 16 hours ago [-]
love the name, LMAO
_carljm 23 hours ago [-]
There may be a future where these are combined into a single language server; we're working on the details.
In the meantime, I think there are "LSP multiplexers" which can present a single language server to your editor and proxy multiple language servers, though I don't have personal experience using these.
Great work by Astral. The 24x speedup at OpenAI is impressive. How smooth is the migration from mypy to ty for existing projects?
sharkdp 9 hours ago [-]
ty does not aim to be a drop-in replacement for Mypy (there are many things that we wanted to improve), so migration does take some effort. You can find migration tips in our documentation here: https://docs.astral.sh/ty/coming-from-mypy-or-pyright/
BoumTAC 1 days ago [-]
Too bad it doesn't support Django 6.
The real issue is that ty's Django support is still early: reverse relations and django-stubs aren't supported yet, and django-types is already lagging behind Django 6.
NostraDavid 1 days ago [-]
> ty also includes built-in support for foundational Python libraries like Pydantic, Django, pytest, and attrs
Does adding `django-stubs` not work?
I haven't tried it myself, as I don't use Django.
BoumTAC 1 days ago [-]
No, it doesn't support reverse relations for example
seanw444 1 days ago [-]
Been using Ty for nearly a year or so now on my Django backend. Been very impressed as I've seen the versions tick up and up. Thanks for this.
diogofonseca 10 hours ago [-]
Fast is the key word here — Python finally getting a type checker that keeps up is very welcome.
lastofus 20 hours ago [-]
Has anyone had success integrating a type checker like Ty, Pyright, MyPy etc. into a large Django monolith that currently has no type checking at all?
zbentley 19 hours ago [-]
Yes, but most of the success was rooted in refactoring code (frequently changing subtle behavior or performance characteristics, and occasionally changing larger behaviors) to make the Django code typechecking-friendly.
It did end up feeling pretty ceremonial to use. The end state was a lot better than the original state, and bugs less common. But the code that we ended up with had some significant perf issues (e.g. difficulties in typechecking queries which joined through arbitrary sub-QuerySet objects or F/Q objects meant that support for those was removed from a lot of common APIs and reserved for the internals of a few per-usecase functions), and ... frankly felt like the more tedious parts of vanilla Java at times.
The pattern of "make a type-parametrized and fully annotated wrapper containing just the methods/data you expect to be able to call on some large and extensively-metaprogrammed model/form/view, pass that wrapper to code that needs its functionality by hand, old-school-dependency-injection-style" worked well as a way of delineating new/typechecked code from e.g. aspirationally-typed methods added to a large and impossible-to-type pre-existing object.
Again, better than before. Just ... a lot more invasive than "just add types/wrappers" and a bit more tedious to use afterwards.
barelysapient 1 days ago [-]
What's the thinking on the future of Python outside of AI specific tasks?
In a post-AI world I imagine most projects will reach for a sensible static code alternative.
atomicnumber3 24 hours ago [-]
If anything, I personally expect python use to increase.
Python in 2026 is basically as typed as you want it to be. I've been seeing a ton of success from telling my agents to type-hint extensively, and then throw in things like pydantic, which can do all of the messy json-parsing-dict-soup for you behind the scenes, and you have a perfect blend where you have types where they help, and then can skip them where they don't (test code, messy parsing pydantic might not cover, etc).
Agents benefit from the huge amounts of training data, and the ability to interact with the code in a way it can't in rust. Notably, claude (and distillations thereof) are clearly trained to use python for lots of general "bash-ish" type calls, and then your language being python + your code being python then lets it get super creative in exploring and figuring stuff out.
And finally, python being easy and expressive for humans to write carries over to agents too, IME. They just do really well with it.
Just my 2c. Everyone keeps saying they don't read the code anymore, so it might as well be rust. But somehow I keep ending up needing to look at code, and when I do, I still prefer it to be python. And am annoyed when it's not (e.g. at work).
ibejoeb 23 hours ago [-]
Some problems beg for Django. There's really nothing else like it. You can do some amazing stuff with Django and Unfold, and agents are happy to write it.
But yeah aside from an AI lab where python was the lingua franca, I haven't felt the need to reach for python itself in years.
pratzc07 23 hours ago [-]
Personally speaking with all these companies rewriting their stuff in Rust I don't see much use case for Python unless you are in ML research.
__mharrison__ 20 hours ago [-]
Small scripts and tools remain in Python. Data science needs Python for exploratory type work. Backend stuff can use whatever language works for the business.
lemontheme 1 days ago [-]
Last time I evaluated ty and pyrefly, I ended up sticking with basedpyright. Its type inference felt the most complete. Curious to see if things have changed.
Oh damn, completely missed this. Thanks for bringing it to my attention.
> As of writing this, more of the rules covered by basedpyright are covered by *pyrefly* than ty, and there are a few missing features in ty that make it not really feasible to use yet in real projects
(My emphasis.) Seems I'll be switching to pyrefly then.
Detachhead has done such a good job bringing pylance's proprietary features to the masses. I also appreciated how he just cut through the bullshit in the pyright issue tracker.
So reading this part, I feel for him:
> what AI has done to programming has significantly impacted my motivation to work on open source projects. [..] In fact I kinda no longer really enjoy interacting with other developers at all.
darkwi11ow 1 days ago [-]
I switched from pyright to pyrefly like 6 months ago, and it's been fantastic
so far. It has holes on some packages that use complicated meta-programming tricks, like sqlalchemy, but other than that no issues. It certainly finds more code smells
than pyright for me.
est 18 hours ago [-]
Does this mean I can unintall basedpyright and nodejs stuff?
geophph 17 hours ago [-]
Yes
ocamoss 1 days ago [-]
congrats to the team!
ethnrob 1 days ago [-]
So if OpenAI owns Astral, and Microsoft has Pyright, don't two companies effectively dominate both Python and TypeScript ecosystems?
I have nothing against Ty, it is quite powerful, and released under MIT.
This blog post also tells us that Ty is used extensively at OpenAI, like we're meant to be impressed.
arthur-st 1 days ago [-]
Pyrefly (Meta) has been the preferred type checker in my social circles for Python, for a while now. OpenAI acquisition in this regard has been viewed as a net negative, if anything, for using Astral's tools. OpenAI has yet to establish a track record for maintaining open-source software for years, the company is simply too young.
> So if OpenAI owns Astral, and Microsoft has Pyright, don't two companies effectively dominate both Python and TypeScript ecosystems?
I got a 2 weeks ban on the python discuss instance for suggesting that core contributors who contribute as their job should disclose who their employer is.
pronik 1 days ago [-]
Microsoft owns the .NET ecosystem and the npm ecosystem via GitHub (which in itself is a massive asset). Broadcom basically owns modern enterprise Java stack via SpringSource. Nothing to be seen here apart from companies realizing there is value in ecosystems (decades after Oracle/Java). OpenAI buying Astral (and investing heavily) was a way to dominate the Python ecosystem. Anthropic has bought Oven (i.e. Bun), but the jury is still out on that one in terms of market or ecosystem domination (watch out for upcoming AoT release though).
akimworks 23 hours ago [-]
Looks like Rust single-handedly improved python's ecosystem!
running ruff + mypy + pytest after every change, ruff is basically instant while mypy is always the slow part of the loop.
alessiorossi 24 hours ago [-]
Fast type checking is very welcome here
hauntingseaweed 19 hours ago [-]
Cool. I’ll vibe code something very similar with Claude.
shantnutiwari 6 hours ago [-]
I will get downvoted but I haev to say it:
SIGH another one
will_raphaelson 23 hours ago [-]
sick!
t9tokenbudget 6 hours ago [-]
[dead]
rushabh5000 17 hours ago [-]
[dead]
listinglens 12 hours ago [-]
[dead]
yoy0721 17 hours ago [-]
[dead]
hz_builds 4 hours ago [-]
[dead]
luminarklabs 14 hours ago [-]
[dead]
xiaoliangliang 18 hours ago [-]
[dead]
outageroom 7 hours ago [-]
[dead]
chrikrah 1 days ago [-]
Tried it on a 10k loc project which never had a type checker: 0.5s, 450 results. More than 400 of them are one pattern, a dict of kwargs splatted into a call (`*kw`). ty infers the dict as `dict[str, str | int]` and flags every parameter against that. Is there any way to type the dict once, or is a TypedDict the way to go?
ibraheemdev 1 days ago [-]
We do generally support this pattern for dictionary literals, but we can't track the precise types of arbitrary keys if the dictionary is created dynamically, you'd have to use a TypedDict in that case.
chrikrah 15 hours ago [-]
Thanks, I think I'll will be adding it to my project.
From my experience working with complicated python dicts in an established project and trying to rely on the automatic inference, putting off making a TypedDict, I'd say don't do it.
Just make the typed one immediately and save yourself the headache. Though in my case ty was actively updating and messing with the dicts, so a valid inference one day would be invalid the next time I updated dependencies (new rules would help in other places, so I would gain some and lose some from doing this).
Summarizing, for something that is an argument with specific fields you'd use a Mapping or a MutableMapping as the annotation, and if that's a return value, then it should be a TypedDict. Sometimes TypedDict also makes sense as an argument annotation, e.g., if it has to be a dict strictly.
For a generic dictionary, like you know that you're drawing from a set of possible kwargs that are all string values, you can also just annotate them with an "anonymous" dict like what Ty is inferring on your codebase.
iceskysl 12 hours ago [-]
[dead]
Aryan_Patil5 6 hours ago [-]
[dead]
CylVolumeCalc 15 hours ago [-]
[dead]
oiwdis 1 days ago [-]
[dead]
hackerbone 12 hours ago [-]
[dead]
122339817 1 days ago [-]
I thought everything can be vibe coded in Rust. Turns out OpenAI are Luddites and use Python.
Remember when Astral told us in 2024 they would not sell out?
analog_daddy 1 days ago [-]
If there are license changes or any user hostile behavior then you might say they sold out. But so far, they have been improving the ecosystem!
Thanks for the great work team! Congratulations on reaching another milestone.
zanie 23 hours ago [-]
Appreciate it <3
ameliaquining 1 days ago [-]
Ty is, in fact, written in Rust with substantial AI assistance. I think it is reasonably uncontroversial that Python remains the more suitable language for ML research, which of course is something that OpenAI cares about very much.
LtWorf 22 hours ago [-]
> Remember when Astral told us in 2024 they would not sell out?
It was VC owned from the start, not a community project.
fhn 1 days ago [-]
everybody sells out at the right price. You're a sellout just by working for someone.
nurettin 1 days ago [-]
By sellout they mean someone breaking promises for money. Not someone who is selling things/skills/time for money.
wpietri 1 days ago [-]
Nope. Getting paid and selling out are distinct things. It depends on whether your integrity is included in the sale price.
globular-toast 1 days ago [-]
I got excited when ty came out because the LSP experience was so much better than I had before with pylsp-mypy. But then I lost interest in programming due to AI. I've been watching the releases and it's pretty obvious there's a lot of "AI assisted" development going on. Kinda funny that they're using AI to make a tool which is pointless because of AI.
q4y2u35uk 24 hours ago [-]
> pretty obvious there's a lot of "AI assisted" development going on
I don't think it's that bad? They don't sign commits with Codex, the agent-specific documentation is very minimal, human discussion still takes place on every PR. Obviously the devs are using AI to some capacity, that's true of every project still developed these days. Compared to projects like Bun, the AI usage seems perfectly responsible.
edstarch 1 days ago [-]
But type checking is useful to AI?
ocamoss 1 days ago [-]
I think the IDE part of it is less important now, since AI generally isn't trained to use/doesn't need to use a language server.
alexwaygood 1 days ago [-]
I think it depends on whether you're working on a project where you're ready to fully cede control to AI agents, or whether you're still interested in reviewing/understanding the code your agents are writing.
For me personally, it's very much the latter -- I extensively review the code my agents write when working on ty. It's fantastic that the codex app, for example, now allows me to use Language Server integrations when I'm reviewing the code that my agents have written. Goto definition, on-hover documentation, etc. in the codex app are all fantastic developments, and they're all powered by language servers.
When I'm working on ty itself, I'm obviously using Rust language servers inside the codex app. But ty is now also the bundled language server for working on Python in the codex app!
ocamoss 20 hours ago [-]
Ah yeah I think there's some divergence of workflows now, compared to a few years ago when the IDE was more dominant.
Compared to before it feels like there are more ppl operating at what was previously an architect's level of abstraction where they aren't clicking thru and exploring most of the code that their team (of agents) produces.
killix 23 hours ago [-]
[dead]
gebt 21 hours ago [-]
Taiwan!
somesun 18 hours ago [-]
now ai do all coding , LSP seems not useful as before.
rkangel 11 hours ago [-]
If that's the case, then why does claude request the Pyright LSP plugin to help navigate code?
sumwise 1 days ago [-]
[flagged]
pratzc07 23 hours ago [-]
Do people write code these days in the year of our lord of AI agents.
__mharrison__ 20 hours ago [-]
AI writes my code.. But it also writes my Python types and checks them with ty.
prollings 23 hours ago [-]
yes. but on a similar note: who you're responding to doesn't appear to have even written their own comment.
IshKebab 22 hours ago [-]
I just tell Claude "add a parameter to this function called foo with type int, and change it to return a + foo instead of a". It's the future! I'm only semi joking.
At the time, ty had a conformance suite pass rate of 53% and pyrefly of 88% vs. pyright's 98% (and I didn't know zuban)
Now [1] pyrefly and zuban both sit at 100%, ty at 97% and pyright at 96%
Time to re-evalute
[1] https://github.com/python/typing/blob/main/conformance/resul...
As far as I can tell:
- pyrefly -> Meta - pyright -> Microsoft - ty -> OpenAI - zuban -> 1 courageous person
Can be both a good and a bad thing
https://github.com/adsharma/fquery/blob/main/tests/django_ex...
https://github.com/adsharma/fastapi-shopping/blob/main/src/f...
It doesn't cover querysets, but it covers most of the model attributes automatically. It's not 100% perfect but it's way better than nothing and it allows you to check a lot of things ty and pyright.
https://gist.github.com/rtpg/ac1950e6c390ddd7a02ddc941ee75c5...
I beg everyone thinking of writing an ORM or a validation framework to look at my gist and internalize it. You don't need top-level type annotations to get type checking form mypy and friends!
People's first idea when trying to tackle types in Python is "OK I want this field to be an int so I will have an API that labels it an int" but if you lean into descriptors you will get a much more flexible system that can handle more scenarios.
Being able to distinguish "types that can be written to a field" from "types that are read from a field" in particular are _so straightforward_ all things considered.
This doesn't solve a lot of the reverse relation issues and annotations on querysets but neither does your library.
I maintain one such transpiler.
Dependent types that can be machine translated to lean4 proposed here. Google static python skill.
https://github.com/py2many/static-python-skill
This is not true. Python's typing system is based on two typing formalisms that are well studied in the academic literature: set-theoretic typing and gradual typing. We've drawn a lot of inspiration in particular from the work done by Giuseppe Castagna and his collaborators.
Elixir's type system is based on exactly the same formalisms, and our teams have met several times to share notes on the underlying concepts, and on implementation techniques. Guillaume Duboc's PhD thesis, which he defended earlier this year, is a particularly strong example of this; we were able to implement an incredibly effective optimization [1] based on his work optimizing disjunctive types in Elixir's type checker.
Now, it's definitely true that Python is a very complex language, and so its type system does not (and cannot) implement the academic set-theoretic algorithms directly. But it provides exactly the formalism that we need to reason about the kinds of code that appears in real-world Python programs.
[1] https://github.com/astral-sh/ruff/pull/23881
If you're trying to make things better for python as it stands now, this is a reasonable path to take.
But there are alternatives. Like the one py2many is pursuing. We seek to build a language that's syntactically similar to CPython, but has a type system similar to ML derived languages.
https://github.com/py2many/py2many/issues/804
https://gist.github.com/adsharma/5ae08fa2e736d72b667f68c4061...
[2] https://github.com/astral-sh/ruff/pull/28457
I do want to have better ergonomics for the type-level programming overall. Typescript is a relative joy to work on (still a pain), but even just some simple "attribute mapping" mechanisms would be cool
I mean just abstractly speaking you can define semantics on a typing relation that behaves this specific way based on a class definition. You have to futz around a bit to distinguish writes from reads, but it's "just" busywork IMO. I don't believe there's some semantic difficulties there. Subtyping issues are way worse than this, at first blush (ready to be told otherwise though!)
> I'm also of the opinion that any such type enhancements have to be friendly towards machine translation to Rust.
I mean that's your opinion. I have nothing against Rust and use it but my objective in using Python is to use Python.
The rate at which people are rewriting python in Rust, there will be very little left.
My goal for the last 5 yrs has been to make sure they don't do it manually.
Much of the resistance I run into is because of exactly this sentiment, which I think will be overcome because of market and technological pressures.
I also believe that a smaller subset of python is more amenable to formal verification some of it via the type system vs something like Verus/Rust.
Despite the name containing dataclass, it can work for Django.
Theorically, you can now do this: https://www.pystebin.com/p/06b0fd4e-e84c-7099-8000-09197d731...
Django does not use it right now, and we are limited to using stubs. They do work pretty well.
But what I mean is, it's not limited by Python type design anymore.
I've argued with pydantic, sqlmodel and Django people that they should replace them with decorators instead.
This will primarily help with automatic translation to Rust.
They have benchmark graphs which aren't properly labeled; the links (when they exist below) do not give a more full picture (you just have to jump back and forth and try to map the table to the graphs somehow?); and the year-over-year growth chart feels weird. The YoY chart makes me want to know more about why mypy grew 4x from 2025 to 2026 than it makes me feel like Ty has healthy growth. It also is concerning why they chose to emphasize growth of the user base over the actual type checking advantages that Ty gives: especially the advancements 1.0 gives.
It's a mishmash of information and feels lacking.
A healthy ecosystem around a tool is important, especially a type checker since you want library authors to prioritize a good experience for your tool of choice. It is noteworthy here that ty adoption has grown significantly beyond the rates of other tools.
`mypy` has caught missed pieces of refactors that were simply never checked anywhere else. It’s found confusing type declarations and outright logic errors, way more than I thought it would in an otherwise well-structured and heavily annotated code base.
But if you start writing complex unions or typed dicts and nothing’s checked then yeah.
(I am on the team and can look into improving them if something can be clearer)
What do any of these mean? What distinguishes the one in the top left from the other clusters of bars?
Each cluster represents a popular open source project we used for benchmarking.
If you open the svg in a new tab, can you see the titles? e.g., https://astral.sh/static/ty-stable/check-desktop.svg?v=8f9fd...
We should also support attribute docstrings everywhere now.
Any indication of when that was? Just being curious.
"Spoiled" is not the word I'd use. In my admittedly brief experience all the Python type checkers are terrible in practice, and the problem is Python. You know in which languages type checkers work? Elm, Gleam, Haskell, etc. There's usually one type checker and it works – there's no need to create several competing-but-all-broken-in-various-ways type checkers.
Ty – A fast Python type checker, written in Rust - https://news.ycombinator.com/item?id=46100637 - Nov 2025 (15 comments)
Pyrefly vs. Ty: Comparing Python's two new Rust-based type checkers - https://news.ycombinator.com/item?id=44107655 - May 2025 (160 comments)
Ty: A fast Python type checker and language server - https://news.ycombinator.com/item?id=43918484 - May 2025 (287 comments)
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.
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”.
This style of development is unfair to innovators and ossifies the ecosystem.
But (1) django is older than Python's type system, so it uses some very dynamic patterns that are hard to express using Python types. And (2) it's very popular, which means both that lots of people want their type checker to do Something Useful™ with django code, and that it would be very difficult to retrofit django to use dynamic patterns that _are_ more compatible with the type system. That combination makes it worth our time to add specific custom support for it.
For your own future library, the hope is that the type system has become capable enough that you wouldn't _need_ custom type checker support. Things like `dataclass_transform` [1] were added specifically so that _all_ libraries could express these kinds of things in ways that are visible to the type checkers without custom support.
If you're doing something that still doesn't fit into what the typing system provides, then the Python typing community wants to learn about your use case so that we can see if we can extend the typing system even further to support it.
[1] https://typing.python.org/en/latest/spec/dataclasses.html
- Adding field X also adds field x_pk
- Adding field X also changes the signature of function Y to accept parameter x, x__lt, x__gt, etc.
- Adding field X lets you do a.x = 5, even though X is not really an integer
As an aside, I have to give it to the Typescript team for taking Javascript which was fundamentally as metaprogramming happy as Python, and creating a type system that matched it. Having a goal that every popular pattern in Javascript should be type-checked was a great starting choice, because they couldn't simply copy some other languages' static typing methadology and had to work from teh ground up.
And that's just the core Django dynamism; the stuff that needs to work really well. Not even getting into stuff that would be nice, like custom managers providing methods to model instances, Q/F type helpers, any sort of typing help with templates (even just "can this method be called with the signature this template wants"), complex model introspection typing, something cleaner than pydantic/manual TypedDicts for form data at the ser/de boundary, and so on.
Even that bare minimum requires some pretty difficult features, type-checker wise: extremely distant dependent types ("if field X exists, method Y should take kwargs X__in and so on" as in your example, as well as "if field X exists, method get_X must be declared on class Y with signature Z", and "if field X exists, then a very distant method in a model manager needs to be documented to return type Y if values_list=True"), very robust support for runtime-created signatures that in a lot of Django systems cannot be generated and checked in (e.g. database-derived models or JSON-backed fields outside of Postgres), extremely complex dependent typing in classes whose generic bounds are determined pretty late/at mixin time (but which may also conceptually be mixins that can only be used in a very few appropriate cases), and more.
Like, just think about model field names in manager method arguments--a tiny fraction of the problem. All the different chained/related kwargs would have to be computed and typed, as well as their disjoint: if I rename field "foo" to "bar", and forget to update some caller that does "m.objects.filter(thing__thing2_fk__foo__in=[1,2])", it'd be great if the type checker could help me catch that. But even if it can't, does that mean that "objects.filter" has all-optional typed kwargs and also takes **kwargs as well, because the type coverage is gradual? As soon as that's allowed, a whole lot of useful typechecking abilities go out the window since misnamed keys can just fall into the wildcard. Solvable, sure, but a major pain in the ass to implement--especially given that Django is a fast-moving target adding/removing/changing functionality all the time.
Again, that's just Django basics. Things that ordinary, bog-standard, not-using-advanced-functionality Django code needs all the time. If the typechecker mishandles one of those cases and makes life harder, people will abandon it. There's a very tricky line to walk here re: when to be strict and when to give up on typechecking entirely, but Django has a lot of places where the latter is necessary.
All of these are known deficiencies. Everyone who brings them up is told to pound sand, their use cases deemed illegitimate. Might as well be GNOME.
It's fundamentally unfair that Django gets to use aspects of the language other tools can't, and one hard coded dataclass-style transform is inadequate.
So help me God, if I ever do another large scale Python project, then if these issues aren't fixed in typing, I will vendor and modify a type checker in the project itself and teach it my project's patterns directly. I will not twist and distort my design vision so it rhymes with dataclass.
You can just ... not typecheck parts of your code. All of these tools are gradual, since Python's much too dynamic to encompass everything. Falling back to runtime "I know how this works" dynamism isn't a sin, it just requires a little care. Add restrictions (typed wrappers, verbosity/limitations a la dataclass_transform) at the boundaries where people make frequent mistakes, and move on with your life.
Plugins do provide a more level playing field, and we aren't closed to the possibility of supporting them in future. But they come with a whole host of challenging technical problems, and we have a lot of other high-priority things to work on.
https://mypy.readthedocs.io/en/stable/config_file.html#confv...
https://github.com/python/typing/issues/275
https://github.com/python/mypy/commit/443c479f2a46967c50d637...
Hmm, that's not accurate anymore! We look for your Python installation in a number of places these days -- we should discover system installations on PATH, conda installations, pixi installations, and, yes, local virtual environments. Is your Python installation at `~/.local` on PATH?
[1] https://docs.astral.sh/ty/coming-from-mypy-or-pyright/#stric...
Funnily though I’ve started to care less about typing in Python. Since Rust got good most projects where I’d want strong types I’m not using Python anymore. Python is still great for glue code, as it was intended. Typing helps there if libraries have good support but I find myself writing Python type annotations less now. It’s always been a bit awkward and ugly in Python anyway.
Python's typing system has really matured and with 3.14 most of the ergonomic issues have been ironed out. Between that and AI coding there's no good reason not to have strict type checking on your python code. But mypy is simply too slow to use in practice though so it'll be between ty and pyrefly I guess.
By the author of Emacs builtin LSP server (eglot), but completely generic.
In the meantime, I think there are "LSP multiplexers" which can present a single language server to your editor and proxy multiple language servers, though I don't have personal experience using these.
The real issue is that ty's Django support is still early: reverse relations and django-stubs aren't supported yet, and django-types is already lagging behind Django 6.
Does adding `django-stubs` not work?
I haven't tried it myself, as I don't use Django.
It did end up feeling pretty ceremonial to use. The end state was a lot better than the original state, and bugs less common. But the code that we ended up with had some significant perf issues (e.g. difficulties in typechecking queries which joined through arbitrary sub-QuerySet objects or F/Q objects meant that support for those was removed from a lot of common APIs and reserved for the internals of a few per-usecase functions), and ... frankly felt like the more tedious parts of vanilla Java at times.
The pattern of "make a type-parametrized and fully annotated wrapper containing just the methods/data you expect to be able to call on some large and extensively-metaprogrammed model/form/view, pass that wrapper to code that needs its functionality by hand, old-school-dependency-injection-style" worked well as a way of delineating new/typechecked code from e.g. aspirationally-typed methods added to a large and impossible-to-type pre-existing object.
Again, better than before. Just ... a lot more invasive than "just add types/wrappers" and a bit more tedious to use afterwards.
In a post-AI world I imagine most projects will reach for a sensible static code alternative.
Python in 2026 is basically as typed as you want it to be. I've been seeing a ton of success from telling my agents to type-hint extensively, and then throw in things like pydantic, which can do all of the messy json-parsing-dict-soup for you behind the scenes, and you have a perfect blend where you have types where they help, and then can skip them where they don't (test code, messy parsing pydantic might not cover, etc).
Agents benefit from the huge amounts of training data, and the ability to interact with the code in a way it can't in rust. Notably, claude (and distillations thereof) are clearly trained to use python for lots of general "bash-ish" type calls, and then your language being python + your code being python then lets it get super creative in exploring and figuring stuff out.
And finally, python being easy and expressive for humans to write carries over to agents too, IME. They just do really well with it.
Just my 2c. Everyone keeps saying they don't read the code anymore, so it might as well be rust. But somehow I keep ending up needing to look at code, and when I do, I still prefer it to be python. And am annoyed when it's not (e.g. at work).
But yeah aside from an AI lab where python was the lingua franca, I haven't felt the need to reach for python itself in years.
https://detachhead.codeberg.page/workproperly/blog/2026/11/2...
> As of writing this, more of the rules covered by basedpyright are covered by *pyrefly* than ty, and there are a few missing features in ty that make it not really feasible to use yet in real projects
(My emphasis.) Seems I'll be switching to pyrefly then.
Detachhead has done such a good job bringing pylance's proprietary features to the masses. I also appreciated how he just cut through the bullshit in the pyright issue tracker.
So reading this part, I feel for him:
> what AI has done to programming has significantly impacted my motivation to work on open source projects. [..] In fact I kinda no longer really enjoy interacting with other developers at all.
I have nothing against Ty, it is quite powerful, and released under MIT.
This blog post also tells us that Ty is used extensively at OpenAI, like we're meant to be impressed.
https://zubanls.com
I got a 2 weeks ban on the python discuss instance for suggesting that core contributors who contribute as their job should disclose who their employer is.
SIGH another one
With the TypedDicts I'm now down to 109 from 450: https://github.com/Plexito-de/spantruth/pull/121
Just make the typed one immediately and save yourself the headache. Though in my case ty was actively updating and messing with the dicts, so a valid inference one day would be invalid the next time I updated dependencies (new rules would help in other places, so I would gain some and lose some from doing this).
Summarizing, for something that is an argument with specific fields you'd use a Mapping or a MutableMapping as the annotation, and if that's a return value, then it should be a TypedDict. Sometimes TypedDict also makes sense as an argument annotation, e.g., if it has to be a dict strictly.
For a generic dictionary, like you know that you're drawing from a set of possible kwargs that are all string values, you can also just annotate them with an "anonymous" dict like what Ty is inferring on your codebase.
Remember when Astral told us in 2024 they would not sell out?
It was VC owned from the start, not a community project.
I don't think it's that bad? They don't sign commits with Codex, the agent-specific documentation is very minimal, human discussion still takes place on every PR. Obviously the devs are using AI to some capacity, that's true of every project still developed these days. Compared to projects like Bun, the AI usage seems perfectly responsible.
For me personally, it's very much the latter -- I extensively review the code my agents write when working on ty. It's fantastic that the codex app, for example, now allows me to use Language Server integrations when I'm reviewing the code that my agents have written. Goto definition, on-hover documentation, etc. in the codex app are all fantastic developments, and they're all powered by language servers.
When I'm working on ty itself, I'm obviously using Rust language servers inside the codex app. But ty is now also the bundled language server for working on Python in the codex app!
Compared to before it feels like there are more ppl operating at what was previously an architect's level of abstraction where they aren't clicking thru and exploring most of the code that their team (of agents) produces.