MCPcopy Index your code
hub / github.com/python/mypy / get_deprecated

Method get_deprecated

mypy/semanal.py:1399–1407  ·  view source on GitHub ↗
(expression: Expression)

Source from the content-addressed store, hash-verified

1397
1398 @staticmethod
1399 def get_deprecated(expression: Expression) -> str | None:
1400 if (
1401 isinstance(expression, CallExpr)
1402 and refers_to_fullname(expression.callee, DEPRECATED_TYPE_NAMES)
1403 and (len(args := expression.args) >= 1)
1404 and isinstance(deprecated := args[0], StrExpr)
1405 ):
1406 return deprecated.value
1407 return None
1408
1409 def process_overload_impl(self, defn: OverloadedFuncDef) -> None:
1410 """Set flags for an overload implementation.

Calls 3

isinstanceFunction · 0.85
refers_to_fullnameFunction · 0.85
lenFunction · 0.85

Tested by

no test coverage detected