[docs] [issue32216] Document PEP 557 Data Classes

Christopher Barker report at bugs.python.org
Mon Dec 18 21:41:17 EST 2017


Christopher Barker <Chris.Barker at noaa.gov> added the comment:

It was suggested that I could contirbute to the docs of dataclasses in this issue. Which confuses me, as there doesn't appear to be any content here to comment on. But what the heck:

As I've been annoyingly persistent about on the python-dev list, I think we need to be quite careful about making type hints appear to be a requirement for using dataclasses. In order to counter this, we could:

* have the first couple example be type-less:

@dataclass
class C:
    a: ...   # field without a default
    b: ... = 0 # field with a default

or something like that.

Then purposely introduce "how to add type hints" a bit down in the docs.

----------
nosy: +Chris.Barker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32216>
_______________________________________


More information about the docs mailing list