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 2019-10-24 07:47 by eric.smith. 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
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