Tin mới
contextlib — Utilities for with-statement contexts
frozen: If true (the default is False), assigning to fields will generate an exception. This emulates read-only frozen instances. See the discussion below.
metadata: This can be a mapping or None. None is treated as an empty dict. This value is wrapped in MappingProxyType() to make it read-only, and exposed on the Field object. It is not used at all by Data Classes, and is
Python stores default member variable values in class attributes. Consider this example, not using dataclasses: