[issue34387] Deletion of attributes in dataclass is buggy

2018-08-14 Thread Eric V. Smith
Eric V. Smith added the comment: I assume this is the behavior you're seeing: >>> @dataclass ... class C: ... i: int = 0 ... >>> c = C(10) >>> c C(i=10) >>> del c.i >>> c C(i=0) >>> del c.i Traceback (most recent call last): File "", line 1, in AttributeError: i >>> If so, that's the

[issue34387] Deletion of attributes in dataclass is buggy

2018-08-13 Thread Brett Cannon
Brett Cannon added the comment: I agree with Eric that without concrete details I suspect everything is working as expected. E.g. ```python class Foo: attr = -13 ins = Foo() ins.attr = 42 print(ins.attr) del ins.attr print(ins.attr) ``` -- nosy: +brett.cannon title: Deletion of

[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Eric V. Smith
Eric V. Smith added the comment: I think this is just normal behavior with classes. But since you haven't shown any code, I can't tell exactly what you're doing and what you're expecting. When providing bug reports, you need to provide: - Exactly what code you're executing. - Exactly what

[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Kamyar Inanloo
Kamyar Inanloo added the comment: Actually it just sets the attribute to its default value, instead of removing it from the instance. -- ___ Python tracker ___

[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Berker Peksag
Change by Berker Peksag : -- components: +Library (Lib) -Argument Clinic nosy: +eric.smith -larry ___ Python tracker ___ ___

[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Kamyar Inanloo
New submission from Kamyar Inanloo : When using del or delattr on an instance of dataclass, attribute does not get deleted truly! using vars or getattr still returns the deleted attribute just using delattr again raises error! -- components: Argument Clinic messages: 323442 nosy: