[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Eric V. Smith
Eric V. Smith added the comment: Ah, you're right. I did misunderstand. Thanks for correcting me. PR soon. -- nosy: +ned.deily priority: normal -> release blocker ___ Python tracker _

[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Sigurd Ljødal
Sigurd Ljødal added the comment: I think you misunderstood the issue here. I'm not trying to replace the class variable itself, I'm changing another field on a class that has a class variable. The problem is that the replace method includes the class variable in the change dict when copying f

[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the report. This is the same error you get when using any non-field: >>> @dataclass ... class C: ... i: int ... >>> c = C(4) >>> replace(c, i=3) C(i=3) >>> replace(c, j=3) Traceback (most recent call last): File "", line 1, in File "C:\home\er

[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Sigurd Ljødal
New submission from Sigurd Ljødal : The dataclasses.replace function does not work for classes that have class variables. See the console output below for an example. $ python Python 3.7.0b5+ (heads/3.7:3c417610ad, Jun 7 2018, 16:21:29) [Clang 9.1.0 (clang-902.0.39.2)] on darwin Type "help",