ruff
f970a871 - [ty] Skip discarded TypedDict validation diagnostics in union matching (#30435)

Commit
18 hours ago
[ty] Skip discarded TypedDict validation diagnostics in union matching (#30435) ## Summary When ty checks a dictionary literal against a union of `TypedDict`s, it tries each arm. A key that belongs to one arm can look like a typo in another, so ty may format a diagnostic and suggest a correction that it immediately discards. We now infer the keys and values first, then skip building diagnostics while deciding which arms match. A literal like `{"foo": len(text, text)}` still reports the extra argument when it matches the arm that defines `foo`. | Project | Base instructions | PR instructions | Change | Paired range | | --- | ---: | ---: | ---: | ---: | | [Black](https://github.com/psf/black/tree/55996d1fb8342725c8a19b6023cd9439c3c1d6f7) | 3,140,770,360.5 | 3,137,027,790.5 | -0.12% | -0.13% to -0.11% | | [discord.py](https://github.com/Rapptz/discord.py/tree/65232c38702be5844cf2ce865a4777eb1928b5d0) | 8,232,469,551 | 8,233,123,492 | +0.01% | -0.03% to +0.05% | | [Django](https://github.com/django/django/tree/b501b8493f31cf8cba31211d59b3b78642b8cb02) | 13,859,221,971.5 | 13,850,681,780.5 | -0.06% | -0.08% to -0.04% | | [FastAPI](https://github.com/fastapi/fastapi/tree/7a0a3f0b286c6c865cf4398ea0e957a87b8bffa4) | 2,999,919,456.5 | 2,996,875,136 | -0.10% | -0.13% to -0.07% | | [Home Assistant](https://github.com/home-assistant/core/tree/c19ae285ede74cd64c3045a3a4aa43290c224f1b) | 159,297,355,749 | 159,179,851,629.5 | -0.07% | -0.08% to -0.06% | | [HTTPX](https://github.com/encode/httpx/tree/b5addb64f0161ff6bfe94c124ef76f6a1fba5254) | 1,654,221,315.5 | 1,653,379,684.5 | -0.05% | -0.11% to +0.01% | | [isort](https://github.com/pycqa/isort/tree/a514c71ed86c2216d0040c7d60e302ed76a4f7ab) | 1,822,079,469.5 | 1,823,644,659.5 | +0.09% | +0.01% to +0.16% | | [Jinja](https://github.com/pallets/jinja/tree/5ef70112a1ff19c05324ff889dd30405b1002044) | 1,911,129,017.5 | 1,909,878,478.5 | -0.04% | -0.39% to +0.16% | | [NumPy](https://github.com/numpy/numpy/tree/f9f1772ce010001208475f751d19253469788410) | 9,168,060,822.5 | 9,192,749,321 | +0.50% | -0.59% to +1.14% | | [OpenAI Python SDK](https://github.com/openai/openai-python/tree/f6e8480f9a5b2a4d02b17a1da54a1e57964bc312) | 16,227,951,746.5 | 16,169,160,912 | -0.36% | -0.42% to -0.31% | | [pandas](https://github.com/pandas-dev/pandas/tree/a0225b65720018f4654390bb16d254daa6ee5e54) | 30,369,536,534 | 30,408,037,258 | +0.13% | -0.03% to +0.29% | | [pandas-stubs](https://github.com/pandas-dev/pandas-stubs/tree/8dd6d91b1c05b26e30f7ddbe3dc3d4042a92bdd6) | 2,997,011,422.5 | 2,994,138,124.5 | -0.13% | -0.18% to +0.40% | | [Prefect](https://github.com/PrefectHQ/prefect/tree/a9452ac21852755311913cb27887b083b5007c03) | 4,869,509,965.5 | 4,866,197,388.5 | -0.07% | -0.07% to -0.06% | | [pytest](https://github.com/pytest-dev/pytest/tree/8b005ed7f972987033ec34dc1e68b0635fb8142b) | 8,790,503,701.5 | 8,793,045,752 | +0.03% | +0.02% to +0.03% | | [PyTorch](https://github.com/pytorch/pytorch/tree/ab92945cea42e47ae398aead69af0872d340ea0f) | 97,691,773,077 | 97,621,020,649 | -0.07% | -0.11% to -0.04% | | [Rich](https://github.com/Textualize/rich/tree/9d8f9a372cc5916fd4781fec207ced7ddac2f08f) | 2,679,007,117.5 | 2,685,852,674 | +0.26% | -0.15% to +0.93% | | [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy/tree/10f4d1e2d706a7722ca78e79ce05b00333a7aa5b) | 21,735,030,895 | 21,746,256,356.5 | +0.05% | -0.05% to +0.15% | | [SymPy](https://github.com/sympy/sympy/tree/85d3998a4517ffbc8a9709b8efa769bb417c174a) | 46,442,197,060 | 46,431,993,374 | -0.02% | -0.05% to +0.01% | | [aiohttp](https://github.com/aio-libs/aiohttp/tree/fe099491d275ef2c21bf683e024e34d51ac05d43) | 4,121,467,960 | 4,122,545,338.5 | +0.03% | +0.00% to +0.05% | | [Ansible](https://github.com/ansible/ansible/tree/b4b2b1e82a535d27f902a71fc8396c3af138fca2) | 14,440,181,295 | 14,434,430,642.5 | -0.04% | -0.09% to +0.01% | | [botocore](https://github.com/boto/botocore/tree/e250abbe956da791c16086575e6ddb1f2da81a78) | 2,970,886,867.5 | 2,972,717,691.5 | +0.06% | -0.01% to +0.13% | | [Celery](https://github.com/celery/celery/tree/9c2f238334331db43f15956f131235fd3bb70fd1) | 4,787,468,353.5 | 4,778,570,944 | -0.19% | -0.41% to +0.04% | | [Dask](https://github.com/dask/dask/tree/249a51a1db4261791b93b4ce04e67341729939c3) | 36,417,108,086.5 | 36,372,823,323 | -0.12% | -0.15% to -0.09% | | [NetworkX](https://github.com/networkx/networkx/tree/6855cd586982cc2e4710b8eb87251ccf56674bf1) | 16,594,410,623 | 16,577,662,309.5 | -0.10% | -0.13% to -0.07% | | [Pydantic](https://github.com/pydantic/pydantic/tree/560f0f96a37d6913afdfddb2de22030ef08e68c3) | 19,145,306,834 | 17,675,871,133 | -7.68% | -7.69% to -7.66% | | [scikit-learn](https://github.com/scikit-learn/scikit-learn/tree/ee56c8b5d809dc7b970a140ed501269b63c69cf8) | 78,898,298,589 | 78,936,186,295 | +0.05% | +0.04% to +0.06% | | [Scrapy](https://github.com/scrapy/scrapy/tree/e63a574c767d7a9438c21db158f605f1c44c6e6a) | 8,903,677,644.5 | 8,889,536,056 | -0.16% | -0.29% to -0.03% | | [Transformers](https://github.com/huggingface/transformers/tree/3a134bc37f7c22c801b618e289b0255425f22647) | 104,695,484,029.5 | 104,637,217,395 | -0.06% | -0.07% to -0.04% |
Author
Parents
Loading