classification
Title: dataclasses: Add the field type to Field repr
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.smith Nosy List: eric.smith, miss-islington, ned.deily
Priority: Keywords: patch

Created on 2018-05-15 12:01 by eric.smith, last changed 2018-05-15 13:08 by eric.smith. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6858 merged eric.smith, 2018-05-15 12:17
PR 6859 merged miss-islington, 2018-05-15 12:37
Messages (3)
msg316644 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-05-15 12:01
With the recent (and ongoing) change to string annotations, it's no longer obvious what the type of a field is (normal, ClassVar, or InitVar).

I propose exposing the heretofore undocumented _field_type to the repr. Instead of writing it directly, I'm going to make it say one of:

_field_type=_FIELD
_field_type=_FIELD_CLASSVAR
_field_type=_FIELD_INITVAR

This is because it's an object reference, and would otherwise look like:

_field_type=<object object at 0x10cc5f1f0>

Which is all but useless.
msg316651 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-05-15 12:36
New changeset 01abc6ec3a61769c55ee86834a432fb97801d28f by Eric V. Smith in branch 'master':
bpo-33517: dataclasses: Add the field type to Field repr (GH-6858)
https://github.com/python/cpython/commit/01abc6ec3a61769c55ee86834a432fb97801d28f
msg316652 - (view) Author: miss-islington (miss-islington) Date: 2018-05-15 13:01
New changeset 5c7e079158db869c9ede1ac9b5b9735091d3ffb6 by Miss Islington (bot) in branch '3.7':
bpo-33517: dataclasses: Add the field type to Field repr (GH-6858)
https://github.com/python/cpython/commit/5c7e079158db869c9ede1ac9b5b9735091d3ffb6
History
Date User Action Args
2018-05-15 13:08:55eric.smithsetpriority: release blocker ->
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-05-15 13:01:54miss-islingtonsetnosy: + miss-islington
messages: + msg316652
2018-05-15 12:37:33miss-islingtonsetpull_requests: + pull_request6533
2018-05-15 12:36:30eric.smithsetmessages: + msg316651
2018-05-15 12:17:03eric.smithsetkeywords: + patch
stage: patch review
pull_requests: + pull_request6532
2018-05-15 12:01:16eric.smithcreate