Handled dict and set inside f-string (#4249) (#4563)

This commit is contained in:
Davide Canton
2023-06-09 06:53:13 +02:00
committed by GitHub
parent 2bb32ee943
commit 63fdcea29e
25 changed files with 1380 additions and 207 deletions

View File

@@ -783,6 +783,7 @@ impl<'a> SemanticModel<'a> {
/// Return `true` if the context is in an f-string.
pub const fn in_f_string(&self) -> bool {
self.flags.contains(SemanticModelFlags::F_STRING)
|| self.flags.contains(SemanticModelFlags::NESTED_F_STRING)
}
/// Return `true` if the context is in a nested f-string.