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

Method is_dataclass_transform

mypy/stubgen.py:947–956  ·  view source on GitHub ↗
(self, expr: Expression)

Source from the content-addressed store, hash-verified

945 return self.get_fullname(expr) == "dataclasses.dataclass"
946
947 def is_dataclass_transform(self, expr: Expression) -> bool:
948 if isinstance(expr, CallExpr):
949 expr = expr.callee
950 if self.get_fullname(expr) in DATACLASS_TRANSFORM_NAMES:
951 return True
952 if (spec := find_dataclass_transform_spec(expr)) is not None:
953 self.processing_dataclass = True
954 self.dataclass_field_specifier = spec.field_specifiers
955 return True
956 return False
957
958 def visit_block(self, o: Block) -> None:
959 # Unreachable statements may be partially uninitialized and that may

Callers 1

get_class_decoratorsMethod · 0.95

Calls 3

get_fullnameMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected