mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 00:20:22 +00:00
This commit is contained in:
parent
76d2e56501
commit
f96dfc179f
9 changed files with 3 additions and 135 deletions
|
@ -1717,11 +1717,6 @@ impl<'a> SemanticModel<'a> {
|
|||
self.flags.intersects(SemanticModelFlags::ANNOTATION)
|
||||
}
|
||||
|
||||
/// Return `true` if the model is in a `@no_type_check` context.
|
||||
pub const fn in_no_type_check(&self) -> bool {
|
||||
self.flags.intersects(SemanticModelFlags::NO_TYPE_CHECK)
|
||||
}
|
||||
|
||||
/// Return `true` if the model is in a typing-only type annotation.
|
||||
pub const fn in_typing_only_annotation(&self) -> bool {
|
||||
self.flags
|
||||
|
@ -2403,22 +2398,6 @@ bitflags! {
|
|||
/// [PEP 257]: https://peps.python.org/pep-0257/#what-is-a-docstring
|
||||
const ATTRIBUTE_DOCSTRING = 1 << 25;
|
||||
|
||||
/// The model is in a [no_type_check] context.
|
||||
///
|
||||
/// This is used to skip type checking when the `@no_type_check` decorator is found.
|
||||
///
|
||||
/// For example (adapted from [#13824]):
|
||||
/// ```python
|
||||
/// from typing import no_type_check
|
||||
///
|
||||
/// @no_type_check
|
||||
/// def fn(arg: "A") -> "R":
|
||||
/// pass
|
||||
/// ```
|
||||
///
|
||||
/// [no_type_check]: https://docs.python.org/3/library/typing.html#typing.no_type_check
|
||||
/// [#13824]: https://github.com/astral-sh/ruff/issues/13824
|
||||
const NO_TYPE_CHECK = 1 << 26;
|
||||
/// The model is in the value expression of a [PEP 613] explicit type alias.
|
||||
///
|
||||
/// For example:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue