[ty] Sync vendored typeshed stubs (#20031)

Co-authored-by: typeshedbot <>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
This commit is contained in:
github-actions[bot]
2025-08-21 21:32:48 +00:00
committed by GitHub
parent f82025d919
commit 7a44ea680e
147 changed files with 2478 additions and 2031 deletions

View File

@@ -4680,20 +4680,11 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
}
// Handle various singletons.
if let Type::NominalInstance(instance) = declared.inner_type() {
if instance
.class(self.db())
.is_known(self.db(), KnownClass::SpecialForm)
if let Some(name_expr) = target.as_name_expr() {
if let Some(special_form) =
SpecialFormType::try_from_file_and_name(self.db(), self.file(), &name_expr.id)
{
if let Some(name_expr) = target.as_name_expr() {
if let Some(special_form) = SpecialFormType::try_from_file_and_name(
self.db(),
self.file(),
&name_expr.id,
) {
declared.inner = Type::SpecialForm(special_form);
}
}
declared.inner = Type::SpecialForm(special_form);
}
}

View File

@@ -154,9 +154,10 @@ impl SpecialFormType {
| Self::Intersection
| Self::CallableTypeOf
| Self::Protocol // actually `_ProtocolMeta` at runtime but this is what typeshed says
| Self::Generic // actually `type` at runtime but this is what typeshed says
| Self::ReadOnly => KnownClass::SpecialForm,
Self::Generic => KnownClass::Type,
Self::List
| Self::Dict
| Self::DefaultDict