mirror of https://github.com/astral-sh/ruff
[ty] _typeshed.Self is not a special form (#18377)
## Summary This change was based on a mis-reading of a comment in typeshed, and a wrong assumption about what was causing a test failure in a prior PR. Reverting it doesn't cause any tests to fail. ## Test Plan Existing tests.
This commit is contained in:
parent
9b0dfc505f
commit
363f061f09
|
|
@ -79,7 +79,7 @@ pub enum SpecialFormType {
|
||||||
/// The symbol `typing.Callable`
|
/// The symbol `typing.Callable`
|
||||||
/// (which can also be found as `typing_extensions.Callable` or as `collections.abc.Callable`)
|
/// (which can also be found as `typing_extensions.Callable` or as `collections.abc.Callable`)
|
||||||
Callable,
|
Callable,
|
||||||
/// The symbol `typing.Self` (which can also be found as `typing_extensions.Self` or `_typeshed.Self`)
|
/// The symbol `typing.Self` (which can also be found as `typing_extensions.Self`)
|
||||||
#[strum(serialize = "Self")]
|
#[strum(serialize = "Self")]
|
||||||
TypingSelf,
|
TypingSelf,
|
||||||
/// The symbol `typing.Final` (which can also be found as `typing_extensions.Final`)
|
/// The symbol `typing.Final` (which can also be found as `typing_extensions.Final`)
|
||||||
|
|
@ -227,16 +227,12 @@ impl SpecialFormType {
|
||||||
| Self::TypeGuard
|
| Self::TypeGuard
|
||||||
| Self::TypedDict
|
| Self::TypedDict
|
||||||
| Self::TypeIs
|
| Self::TypeIs
|
||||||
|
| Self::TypingSelf
|
||||||
| Self::Protocol
|
| Self::Protocol
|
||||||
| Self::ReadOnly => {
|
| Self::ReadOnly => {
|
||||||
matches!(module, KnownModule::Typing | KnownModule::TypingExtensions)
|
matches!(module, KnownModule::Typing | KnownModule::TypingExtensions)
|
||||||
}
|
}
|
||||||
|
|
||||||
Self::TypingSelf => matches!(
|
|
||||||
module,
|
|
||||||
KnownModule::Typing | KnownModule::TypingExtensions | KnownModule::Typeshed
|
|
||||||
),
|
|
||||||
|
|
||||||
Self::Unknown
|
Self::Unknown
|
||||||
| Self::AlwaysTruthy
|
| Self::AlwaysTruthy
|
||||||
| Self::AlwaysFalsy
|
| Self::AlwaysFalsy
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue