[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2020-10-18 Thread Irit Katriel
Irit Katriel added the comment: I think you may have meant this issue (which is not related to field()): from dataclasses import dataclass from typing import Callable @dataclass(init=True) class Foo: callback: Callable[[int], int] = lambda x: x**2 @dataclass(init=False) class Bar:

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2020-10-18 Thread Irit Katriel
Irit Katriel added the comment: If I change Foo in your code to: @dataclass(init=False) class Foo: callback: Callable[[int], int] = lambda x: x**2 Then the same TypeError exception is raised for Foo. If I then change it back (remove the init=False so that it picks up the

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2019-12-12 Thread Jeong-Min Lee
Change by Jeong-Min Lee : -- nosy: +falsetru ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2019-12-10 Thread PCManticore
Change by PCManticore : -- nosy: +Claudiu.Popa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2019-12-06 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2019-12-01 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2019-11-30 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2019-11-30 Thread Kevin Shweh
New submission from Kevin Shweh : The following code: from dataclasses import dataclass, field from typing import Callable @dataclass class Foo: callback: Callable[[int], int] = lambda x: x**2 @dataclass class Bar: callback: Callable[[int],