Warn if deprecated.
(self, node: Node | None, context: Context)
| 8406 | self.warn_deprecated(node, context) |
| 8407 | |
| 8408 | def warn_deprecated(self, node: Node | None, context: Context) -> None: |
| 8409 | """Warn if deprecated.""" |
| 8410 | if isinstance(node, Decorator): |
| 8411 | node = node.func |
| 8412 | if ( |
| 8413 | isinstance(node, (FuncDef, OverloadedFuncDef, TypeInfo)) |
| 8414 | and (deprecated := node.deprecated) is not None |
| 8415 | and not self.is_typeshed_stub |
| 8416 | and not any( |
| 8417 | node.fullname == p or node.fullname.startswith(f"{p}.") |
| 8418 | for p in self.options.deprecated_calls_exclude |
| 8419 | ) |
| 8420 | ): |
| 8421 | warn = self.msg.note if self.options.report_deprecated_as_note else self.msg.fail |
| 8422 | warn(deprecated, context, code=codes.DEPRECATED) |
| 8423 | |
| 8424 | def new_unique_dummy_name(self, namespace: str) -> str: |
| 8425 | """Generate a name that is guaranteed to be unique for this TypeChecker instance.""" |
no test coverage detected