[issue36661] Missing dataclass decorator import in dataclasses module docs

Stéphane Wirtel report at bugs.python.org
Fri Apr 19 04:34:54 EDT 2019


Stéphane Wirtel <stephane at wirtel.be> added the comment:

We could change the example with 

```
from dataclasses import dataclass

@dataclass
class InventoryItem:
    ...
```

Because it's not specified in the documentation (header, that we need to
import dataclass from dataclasses).

+1 for a small update.

You are free to propose a PR.

Have a nice day,

>I think the import is implied in the example since the docs page is for
>dataclasses module but adding an explicit import to InventoryItem at
>the top won't hurt too.
Yep, but explicit is better than implicit.

----------
nosy: +matrixise

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


More information about the Python-bugs-list mailing list