ruff
ac31b26a - [red-knot] type[] is disjoint from None, LiteralString (#14967)

Commit
361 days ago
[red-knot] type[] is disjoint from None, LiteralString (#14967) ## Summary Teach red-knot that `type[...]` is always disjoint from `None` and from `LiteralString`. Fixes #14925. This should properly be generalized to "all instances of final types which are not subclasses of `type`", but until we support finality, hardcoding `None` (which is known to be final) allows us to fix the subtype transitivity property test. ## Test Plan Existing tests pass, added new unit tests for `is_disjoint_from` and `is_subtype_of`. `QUICKCHECK_TESTS=100000 cargo test -p red_knot_python_semantic -- --ignored types::property_tests::stable` fails only the "assignability is reflexive" test, which is known to fail on `main` (#14899). The same command, with `property_tests.rs` edited to prevent generating intersection tests (the cause of #14899), passes all quickcheck tests.
Author
Parents
Loading