This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add import statement in dataclass code snippet
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Windson Yang, docs@python, eric.smith, xtreak
Priority: normal Keywords:

Created on 2019-01-15 15:33 by Windson Yang, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg333707 - (view) Author: Windson Yang (Windson Yang) * Date: 2019-01-15 15:33
Most of the example in https://docs.python.org/3/library/dataclasses.html miss code like

from dataclasses import dataclass, field
from typing import List

I think we should add this statement in the code snippet.
msg333708 - (view) Author: Windson Yang (Windson Yang) * Date: 2019-01-15 15:36
I'm not sure if we should put 

from dataclasses import dataclass

everywhere or we should put it just in the first example as I did in the PR.
msg355293 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-10-24 07:50
See also https://bugs.python.org/issue36661
msg355653 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-10-29 13:36
Closed in favor of issue 36661 (which I realize was opened later, but has more discussion, so I'm using it going forward).
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79926
2019-10-29 13:36:08eric.smithsetstatus: open -> closed
resolution: duplicate
messages: + msg355653

stage: resolved
2019-10-24 07:50:34xtreaksetnosy: + eric.smith, xtreak
messages: + msg355293
2019-01-15 15:36:52Windson Yangsetmessages: + msg333708
2019-01-15 15:33:11Windson Yangcreate