Author mturner865
Recipients Windson Yang, brett.cannon, docs@python, eric.smith, matrixise, mfisherlevine, mturner865, xtreak
Date 2019-06-24.00:07:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I tried a couple of the examples from the docs and found the setup to be a little confusing
amd inconsistent. For example, the decorator line "@decorator" requires you to use

from dataclasses import dataclass

while the example line "mylist: List[int] = field(default_factory=list)" requires you to use these

import dataclasses
import typing

and must be modified to
mylist: typing.List[int] = dataclasses.field(default_factory=list)

The decorator line could be modified to be
and the from/import line could be eliminated. But that seems awkward.

So, what is are best practices for handling the imports needed by these examples?
And should the examples be updated to be consistent with a best practice set of imports?
Or am I not understanding how this code works?

Also, the intro section states "If any of the added methods already exist on the class, a TypeError will be raised."
This statement seems incorrect and contrdicts the parameter documentation that follows.
Date User Action Args
2019-06-24 00:07:25mturner865setrecipients: + mturner865, brett.cannon, eric.smith, docs@python, matrixise, Windson Yang, xtreak, mfisherlevine
2019-06-24 00:07:25mturner865setmessageid: <>
2019-06-24 00:07:25mturner865linkissue36661 messages
2019-06-24 00:07:25mturner865create