[flake8-type-checking] Adds implementation for TC007 and TC008 (#12927)

Co-authored-by: Simon Brugman <sbrugman@users.noreply.github.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
David Salvisberg 2024-11-27 09:51:20 +01:00 committed by GitHub
parent e0f3eaf1dd
commit 6fd10e2fe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 1483 additions and 10 deletions

View file

@ -85,6 +85,14 @@ impl ResolvedReference {
self.flags
.intersects(SemanticModelFlags::DUNDER_ALL_DEFINITION)
}
/// Return `true` if the context is in the r.h.s. of a [PEP 613] type alias.
///
/// [PEP 613]: https://peps.python.org/pep-0613/
pub const fn in_annotated_type_alias_value(&self) -> bool {
self.flags
.intersects(SemanticModelFlags::ANNOTATED_TYPE_ALIAS)
}
}
impl Ranged for ResolvedReference {