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: Dataclasses documentation should show the necessary imports
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Missing dataclass decorator import in dataclasses module docs
View: 36661
Assigned To: docs@python Nosy List: Leon Matthews, docs@python, eric.smith
Priority: normal Keywords:

Created on 2019-10-24 07:34 by Leon Matthews, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg355289 - (view) Author: Leon Matthews (Leon Matthews) Date: 2019-10-24 07:34
In the code sample documentation for other modules we show the necessary imports, we should do the same for dataclasses.

For example, the very first example uses the `dataclass` decorator without importing it first. It should read::

    from dataclasses import dataclass

    @dataclass
    class InventoryItem:
        ...
msg355292 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-10-24 07:47
This is a duplicate of issue 36661.
History
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82755
2019-10-24 07:47:04eric.smithsetstatus: open -> closed

superseder: Missing dataclass decorator import in dataclasses module docs

nosy: + eric.smith
messages: + msg355292
resolution: duplicate
stage: resolved
2019-10-24 07:34:34Leon Matthewscreate