[ty] Remove unneeded disjoint-base special casing for builtins.tuple (#20414)

This commit is contained in:
Alex Waygood 2025-09-15 13:12:20 +01:00 committed by GitHub
parent eb71536dce
commit e8b4450125
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1553,11 +1553,7 @@ impl<'db> ClassLiteral<'db> {
/// Return `Some()` if this class is known to be a [`DisjointBase`], or `None` if it is not. /// Return `Some()` if this class is known to be a [`DisjointBase`], or `None` if it is not.
pub(super) fn as_disjoint_base(self, db: &'db dyn Db) -> Option<DisjointBase<'db>> { pub(super) fn as_disjoint_base(self, db: &'db dyn Db) -> Option<DisjointBase<'db>> {
// TODO: Typeshed cannot add `@disjoint_base` to its `tuple` definition without breaking pyright. if self
// See <https://github.com/microsoft/pyright/issues/10836>.
// This should be fixed soon; we can remove this workaround then.
if self.is_known(db, KnownClass::Tuple)
|| self
.known_function_decorators(db) .known_function_decorators(db)
.contains(&KnownFunction::DisjointBase) .contains(&KnownFunction::DisjointBase)
{ {