| 1603 | |
| 1604 | @classmethod |
| 1605 | def read(cls, data: ReadBuffer) -> Var: |
| 1606 | name = read_str(data) |
| 1607 | typ = mypy.types.read_type_opt(data) |
| 1608 | v = Var(name, typ) |
| 1609 | setter_type: mypy.types.CallableType | None = None |
| 1610 | tag = read_tag(data) |
| 1611 | if tag != LITERAL_NONE: |
| 1612 | assert tag == mypy.types.CALLABLE_TYPE |
| 1613 | setter_type = mypy.types.CallableType.read(data) |
| 1614 | v.setter_type = setter_type |
| 1615 | v._fullname = read_str(data) |
| 1616 | ( |
| 1617 | v.is_initialized_in_class, |
| 1618 | v.is_staticmethod, |
| 1619 | v.is_classmethod, |
| 1620 | v.is_property, |
| 1621 | v.is_settable_property, |
| 1622 | v.is_suppressed_import, |
| 1623 | v.is_classvar, |
| 1624 | v.is_abstract_var, |
| 1625 | v.is_final, |
| 1626 | v.is_index_var, |
| 1627 | v.final_unset_in_class, |
| 1628 | v.final_set_in_init, |
| 1629 | v.explicit_self_type, |
| 1630 | v.is_ready, |
| 1631 | v.is_inferred, |
| 1632 | v.invalid_partial_type, |
| 1633 | v.from_module_getattr, |
| 1634 | v.has_explicit_value, |
| 1635 | v.allow_incompatible_override, |
| 1636 | ) = read_flags(data, num_flags=19) |
| 1637 | tag = read_tag(data) |
| 1638 | if tag == LITERAL_COMPLEX: |
| 1639 | v.final_value = complex(read_float_bare(data), read_float_bare(data)) |
| 1640 | elif tag != LITERAL_NONE: |
| 1641 | v.final_value = read_literal(data, tag) |
| 1642 | assert read_tag(data) == END_TAG |
| 1643 | return v |
| 1644 | |
| 1645 | |
| 1646 | class ClassDef(Statement): |