Skip to content

Conversation

@brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Apr 8, 2021

>>> @dataclass(repr=False, eq=False, init=False)
... class X:
...     a: int
...     b: int
...     c: int
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/bucher/src/cpython/Lib/dataclasses.py", line 1042, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "/home/bucher/src/cpython/Lib/dataclasses.py", line 1020, in _process_class
    cls.__match_args__ = tuple(f.name for f in flds if f.init)
UnboundLocalError: local variable 'flds' referenced before assignment

https://bugs.python.org/issue43764

@brandtbucher brandtbucher added the type-bug An unexpected behavior, bug, or error label Apr 8, 2021
@brandtbucher brandtbucher requested a review from ericvsmith as a code owner April 8, 2021 17:13
Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@brandtbucher brandtbucher merged commit d92c59f into python:master Apr 8, 2021
@brandtbucher brandtbucher deleted the dataclass-match-args branch July 21, 2022 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants