[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-20 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-20 Thread Adrian Stachlewski
Adrian Stachlewski added the comment: There's nothing to do, thanks for help one more again. -- status: pending -> open ___ Python tracker

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: Are there any remaining issues here? If not, I'm going to close this issue. -- status: open -> pending ___ Python tracker

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-19 Thread Adrian Stachlewski
Adrian Stachlewski added the comment: Once more same mistake. 'x' should be declared as: - x: ClassVar[set] = set() - x: ClassVar[Set[Any]] = set() -- ___ Python tracker

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-18 Thread Adrian Stachlewski
Adrian Stachlewski added the comment: Thanks for explaining. I was trying to do something like @dataclass class A: x: ClassVar = set() and thanks to you I know it should be @dataclass class A: x: ClassVar[Set] = set() If you are looking for improved error

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-18 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: +Python 3.8 ___ Python tracker ___ ___

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: There are a couple of problems here. You're using ClassVar incorrectly. It should be: >>> @dataclass ... class C: ... __slots__=() ... x: ClassVar[int] = field(default=3) ... >>> C() C() >>> C.x 3 And you cannot have a ClassVar with

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker ___

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-17 Thread Adrian Stachlewski
New submission from Adrian Stachlewski : Class variables should behave in the same way whether with or without ClassVar annotation. Unfortunately there are not. class A: __slots__ = () x: ClassVar = set() A() # it's ok @dataclass class B: __slots__