mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
![]() Prompted by > One nit: I think we need to consider `Any` and `Unknown` and `Todo` as all (gradually) equivalent to each other, and thus `type & Any` and `type & Unknown` and `type & Todo` as also equivalent. The distinction between `Any` vs `Unknown` vs `Todo` is entirely about provenance/debugging, there is no type level distinction. (And I've been wondering if the `Any` vs `Unknown` distinction is really worth it.) The thought here is that _most_ places want to treat `Any`, `Unknown`, and `Todo` identically. So this PR simplifies things by having a single `Type::Any` variant, and moves the provenance part into a new `AnyType` type. If you need to treat e.g. `Todo` differently, you still can by pattern-matching into the `AnyType`. But if you don't, you can just use `Type::Any(_)`. (This would also allow us to (more easily) distinguish "unknown via an unannotated value" from "unknown because of a typing error" should we want to do that in the future) --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Carl Meyer <carl@astral.sh> |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |