Skip to content

Commit bde8ecd

Browse files
authored
[red-knot] Remove unneeded branch in Type::is_equivalent_to() (#15242)
## Summary We understand `sys.version_info` branches now! As such, I _believe_ this branch is no longer required; all tests pass without it. I also ran `QUICKCHECK_TESTS=100000 cargo test -p red_knot_python_semantic -- --ignored types::property_tests::stable`, and no tests failed except for the known issue with `Type::is_assignable_to()` (#14899) ## Test Plan See above
1 parent 842f882 commit bde8ecd

File tree

1 file changed

+0
-20
lines changed
  • crates/red_knot_python_semantic/src

1 file changed

+0
-20
lines changed

crates/red_knot_python_semantic/src/types.rs

-20
Original file line numberDiff line numberDiff line change
@@ -1010,26 +1010,6 @@ impl<'db> Type<'db> {
10101010
return false;
10111011
}
10121012

1013-
// TODO: The following is a workaround that is required to unify the two different versions
1014-
// of `NoneType` and `NoDefaultType` in typeshed. This should not be required anymore once
1015-
// we understand `sys.version_info` branches.
1016-
if let (
1017-
Type::Instance(InstanceType { class: self_class }),
1018-
Type::Instance(InstanceType {
1019-
class: target_class,
1020-
}),
1021-
) = (self, other)
1022-
{
1023-
let self_known = self_class.known(db);
1024-
if matches!(
1025-
self_known,
1026-
Some(KnownClass::NoneType | KnownClass::NoDefaultType)
1027-
) && self_known == target_class.known(db)
1028-
{
1029-
return true;
1030-
}
1031-
}
1032-
10331013
// type[object] ≡ type
10341014
if let (
10351015
Type::SubclassOf(SubclassOfType {

0 commit comments

Comments
 (0)