ruff/crates/ty_python_semantic/resources
Alex Waygood 0b918ae4d5
[ty] Improve check enforcing that an overloaded function must have an implementation (#21978)
## Summary

- Treat `if TYPE_CHECKING` blocks the same as stub files (the feature
requested in https://github.com/astral-sh/ty/issues/1216)
- We currently only allow `@abstractmethod`-decorated methods to omit
the implementation if they're methods in classes that have _exactly_
`ABCMeta` as their metaclass. That seems wrong -- `@abstractmethod` has
the same semantics if a class has a subclass of `ABCMeta` as its
metaclass. This PR fixes that too. (I'm actually not _totally_ sure we
should care what the class's metaclass is at all -- see discussion in
https://github.com/astral-sh/ty/issues/1877#issue-3725937441... but the
change this PR is making seems less wrong than what we have currently,
anyway.)

Fixes https://github.com/astral-sh/ty/issues/1216

## Test Plan

Mdtests and snapshots
2025-12-15 08:56:35 +00:00
..
corpus [ty] disallow explicit specialization of type variables themselves (#21938) 2025-12-12 15:49:20 -08:00
mdtest [ty] Improve check enforcing that an overloaded function must have an implementation (#21978) 2025-12-15 08:56:35 +00:00
primer [ty] Add missing projects to `good.txt` (#21721) 2025-12-01 11:18:41 +01:00
README.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00

README.md

Markdown files within the mdtest/ subdirectory are tests of type inference and type checking; executed by the tests/mdtest.rs integration test.

See crates/ty_test/README.md for documentation of this test format.