mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:14:52 +00:00
[ty] Remove unneeded disjoint-base special casing for builtins.tuple
(#20414)
This commit is contained in:
parent
eb71536dce
commit
e8b4450125
1 changed files with 3 additions and 7 deletions
|
@ -1553,13 +1553,9 @@ impl<'db> ClassLiteral<'db> {
|
|||
|
||||
/// 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>> {
|
||||
// TODO: Typeshed cannot add `@disjoint_base` to its `tuple` definition without breaking pyright.
|
||||
// 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)
|
||||
.contains(&KnownFunction::DisjointBase)
|
||||
if self
|
||||
.known_function_decorators(db)
|
||||
.contains(&KnownFunction::DisjointBase)
|
||||
{
|
||||
Some(DisjointBase::due_to_decorator(self))
|
||||
} else if SlotsKind::from(db, self) == SlotsKind::NotEmpty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue