mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
Implement PEP 585 annotation rewrites (#368)
This commit is contained in:
@@ -92,3 +92,10 @@ pub fn is_annotated_subscript(name: &str) -> bool {
|
||||
pub fn is_pep593_annotated_subscript(name: &str) -> bool {
|
||||
name == "Annotated"
|
||||
}
|
||||
|
||||
static PEP_585_BUILTINS: Lazy<BTreeSet<&'static str>> =
|
||||
Lazy::new(|| BTreeSet::from(["Dict", "FrozenSet", "List", "Set", "Tuple", "Type"]));
|
||||
|
||||
pub fn is_pep585_builtin(name: &str) -> bool {
|
||||
PEP_585_BUILTINS.contains(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user