mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:49:50 +00:00
Add Checker::import_from_typing
(#17340)
Summary -- This PR replaces uses of version-dependent imports from `typing` or `typing_extensions` with a centralized `Checker::import_from_typing` method. The idea here is to make the fix for #9761 (whatever it ends up being) applicable to all of the rules performing similar checks. Test Plan -- Existing tests for the affected rules.
This commit is contained in:
parent
1aad180aae
commit
8e11c53310
13 changed files with 87 additions and 140 deletions
|
@ -44,6 +44,11 @@ impl PythonVersion {
|
|||
.into_iter()
|
||||
}
|
||||
|
||||
/// The minimum supported Python version.
|
||||
pub const fn lowest() -> Self {
|
||||
Self::PY37
|
||||
}
|
||||
|
||||
pub const fn latest() -> Self {
|
||||
Self::PY313
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue