Add all PEP-585 names to UP006 rule (#5454)

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Co-authored-by: dylwil3 <dylwil3@gmail.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
wookie184 2024-12-30 11:21:42 +00:00 committed by GitHub
parent 0b15f17939
commit 04d538113a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 585 additions and 19 deletions

View file

@ -120,10 +120,7 @@ pub fn to_pep585_generic(expr: &Expr, semantic: &SemanticModel) -> Option<Module
.then(|| semantic.resolve_qualified_name(expr))
.flatten()
.and_then(|qualified_name| {
let [module, member] = qualified_name.segments() else {
return None;
};
as_pep_585_generic(module, member).map(|(module, member)| {
as_pep_585_generic(qualified_name.segments()).map(|(module, member)| {
if module.is_empty() {
ModuleMember::BuiltIn(member)
} else {