New submission from Andrew C <andrewon...@gmail.com>:
Hello, When given a `Field` on a Dataclass, the `__repr__` throws an infinite recursive error when the data type is bytes. In the `Field` class, the __repr__ is as follows: ``` def __repr__(self): return ( 'Field(' f'name={self.name!r},' f'type={self.type!r},' f'default={self.default!r},' f'default_factory={self.default_factory!r},' f'init={self.init!r},' f'repr={self.repr!r},' f'hash={self.hash!r},' f'compare={self.compare!r},' f'metadata={self.metadata!r},' f'_field_type={self._field_type}' ')' ) ``` The issue is the f'type={self.type!r}, part of the code. ---------- components: Windows messages: 396250 nosy: andrewonboe, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Dataclass Causes Infinite Recursion when using type of bytes versions: Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44475> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com