[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

@@ -91,14 +91,14 @@ error[missing-argument]: No argument provided for required parameter `arg` of bo
7 | from typing_extensions import deprecated
|
info: Parameter declared here
--> stdlib/typing_extensions.pyi:967:28
--> stdlib/typing_extensions.pyi:973:28
|
965 | stacklevel: int
966 | def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
967 | def __call__(self, arg: _T, /) -> _T: ...
971 | stacklevel: int
972 | def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
973 | def __call__(self, arg: _T, /) -> _T: ...
| ^^^^^^^
968 |
969 | @final
974 |
975 | @final
|
info: rule `missing-argument` is enabled by default

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