New submission from Eric V. Smith <e...@trueblade.com>: For this class:
@dataclass class C: x: int = 0 y = 0 Generate a TypeError. 'y' is not a field (as defined by @dataclass). It should either be a regular field (by giving it a type annotation) or a ClassVar field. ---------- assignee: eric.smith components: Library (Lib) messages: 309065 nosy: eric.smith priority: normal severity: normal status: open title: dataclasses: make it an error to have initialized non-fields in a dataclass type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32428> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com