Rename semantic model flag LITERAL to TYPING_LITERAL (#8997)

This PR renames the semantic model flag `LITERAL` to `TYPING_LITERAL` to
better reflect its purpose. The main motivation behind this change is to
avoid any confusion with the "literal" terminology used in the AST for
literal nodes like string, bytes, numbers, etc.
This commit is contained in:
Dhruv Manilawala 2023-12-04 11:28:09 -06:00 committed by GitHub
parent f5d4676c13
commit 060a25df09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -1359,8 +1359,8 @@ impl<'a> SemanticModel<'a> {
}
/// Return `true` if the model is in a `typing::Literal` annotation.
pub const fn in_literal(&self) -> bool {
self.flags.intersects(SemanticModelFlags::LITERAL)
pub const fn in_typing_literal(&self) -> bool {
self.flags.intersects(SemanticModelFlags::TYPING_LITERAL)
}
/// Return `true` if the model is in a subscript expression.
@ -1576,7 +1576,7 @@ bitflags! {
/// def f(x: Literal["A", "B", "C"]):
/// ...
/// ```
const LITERAL = 1 << 9;
const TYPING_LITERAL = 1 << 9;
/// The model is in a subscript expression.
///