Re: Property for dataclass field with default value

2020-06-19 Thread Peter Otten
Ivan Ivanyuk wrote: > On Thu, 18 Jun 2020 at 11:26, Peter Otten <__pete...@web.de> wrote: >> >> Ivan Ivanyuk wrote: >> >> > Hello All, >> > >> > I have some trouble using @dataclass together with @property decorator >> > or property() function. >> > >> > From the documentation and PEP is seems tha

Re: Property for dataclass field with default value

2020-06-18 Thread Ivan Ivanyuk
On Thu, 18 Jun 2020 at 11:26, Peter Otten <__pete...@web.de> wrote: > > Ivan Ivanyuk wrote: > > > Hello All, > > > > I have some trouble using @dataclass together with @property decorator > > or property() function. > > > > From the documentation and PEP is seems that the intended behaviour of > >

Re: Property for dataclass field with default value

2020-06-18 Thread Peter Otten
Ivan Ivanyuk wrote: > Hello All, > > I have some trouble using @dataclass together with @property decorator > or property() function. > > From the documentation and PEP is seems that the intended behaviour of > @dataclass is to be the same as normal __init__() that sets instance > variables. >

Property for dataclass field with default value

2020-06-17 Thread Ivan Ivanyuk
Hello All, I have some trouble using @dataclass together with @property decorator or property() function. >From the documentation and PEP is seems that the intended behaviour of @dataclass is to be the same as normal __init__() that sets instance variables. But it seems that when using @property