[ty] Sync vendored typeshed stubs (#20031)
Co-authored-by: typeshedbot <> Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f82025d919
commit
7a44ea680e
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user