[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread miss-islington
miss-islington added the comment: New changeset 3b4c6b16c597aa2356f5658dd67da7dcd4434038 by Miss Islington (bot) in branch '3.7': bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation.

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 56970b8ce9d23269d20a76f13c80e670c856ba7f by Eric V. Smith in branch 'master': bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation. (GH-6192)

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +5940 ___ Python tracker ___

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5939 stage: -> patch review ___ Python tracker ___

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the offer. I've already got the code written, I just need to write some tests. I'll get it done real soon now. -- components: +Library (Lib) versions: +Python 3.8 ___ Python tracker

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > you'll notice that's an error? Yes, but there are other scenarios, like using `init=False` or updating existing class definition and forgetting to update call sites (which will still work), etc. What would we lose by not flagging

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: But surely when you instantiate this: c = C(1) you'll notice that's an error? -- ___ Python tracker

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Some part of the discussion is in https://bugs.python.org/issue32428 I still think it is important to flag things like this as an error: @dataclass class C: x = field() This is a big bug magnet. Especially taking into account that

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Guido van Rossum
Guido van Rossum added the comment: Fine to close as wontfix. -- ___ Python tracker ___

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure this is worth preventing. I can certainly make it an error, but since dataclasses ignores anything without a type annotation, I don't think it's a big deal. Basically I'd have to look through all class attributes that are of

[issue32505] dataclasses: make field() with no annotation an error

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: +Python 3.7 ___ Python tracker ___ ___

[issue32505] dataclasses: make field() with no annotation an error

2018-01-06 Thread Eric V. Smith
New submission from Eric V. Smith : This is an attractive nuisance, especially when coming from attrs. Make it an error, since it's using field() with no annotation: @dataclass class C: x = field() -- assignee: eric.smith messages: 309586 nosy: eric.smith,