mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-28 15:33:50 +00:00
Treat all typing_extensions
members as typing aliases (#9335)
## Summary Historically, we encoded this list by extracting the `__all__`. I went to update it, but... is there really any value in it? Seems easier to just treat `typing_extensions` as an alias for `typing`. Closes https://github.com/astral-sh/ruff/issues/9334.
This commit is contained in:
parent
772e5d587d
commit
195f7c097a
7 changed files with 33 additions and 72 deletions
|
@ -1,63 +1,3 @@
|
|||
/// Returns `true` if a name is a member of Python's `typing_extensions` module.
|
||||
///
|
||||
/// See: <https://pypi.org/project/typing-extensions/>
|
||||
pub fn is_typing_extension(member: &str) -> bool {
|
||||
matches!(
|
||||
member,
|
||||
"Annotated"
|
||||
| "Any"
|
||||
| "AsyncContextManager"
|
||||
| "AsyncGenerator"
|
||||
| "AsyncIterable"
|
||||
| "AsyncIterator"
|
||||
| "Awaitable"
|
||||
| "ChainMap"
|
||||
| "ClassVar"
|
||||
| "Concatenate"
|
||||
| "ContextManager"
|
||||
| "Coroutine"
|
||||
| "Counter"
|
||||
| "DefaultDict"
|
||||
| "Deque"
|
||||
| "Final"
|
||||
| "Literal"
|
||||
| "LiteralString"
|
||||
| "NamedTuple"
|
||||
| "Never"
|
||||
| "NewType"
|
||||
| "NotRequired"
|
||||
| "OrderedDict"
|
||||
| "ParamSpec"
|
||||
| "ParamSpecArgs"
|
||||
| "ParamSpecKwargs"
|
||||
| "Protocol"
|
||||
| "Required"
|
||||
| "Self"
|
||||
| "TYPE_CHECKING"
|
||||
| "Text"
|
||||
| "Type"
|
||||
| "TypeAlias"
|
||||
| "TypeGuard"
|
||||
| "TypeVar"
|
||||
| "TypeVarTuple"
|
||||
| "TypedDict"
|
||||
| "Unpack"
|
||||
| "assert_never"
|
||||
| "assert_type"
|
||||
| "clear_overloads"
|
||||
| "final"
|
||||
| "get_type_hints"
|
||||
| "get_args"
|
||||
| "get_origin"
|
||||
| "get_overloads"
|
||||
| "is_typeddict"
|
||||
| "overload"
|
||||
| "override"
|
||||
| "reveal_type"
|
||||
| "runtime_checkable"
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns `true` if a call path is a generic from the Python standard library (e.g. `list`, which
|
||||
/// can be used as `list[int]`).
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue