Skip to content

WARNING: Cannot treat a function defined as a local function #123

Open
@newAM

Description

@newAM

With python 3.8.1 documenting a dataclass leads to this warning:

WARNING: Cannot treat a function defined as a local function: "mod.Foo"  (use @functools.wraps)

This only occurs in python 3.8.1, python 3.8.0 does not show this warning.

This is minimally reproducible with 3 files:

conf.py

project = "unit_test"
extensions = ["sphinx.ext.autodoc", "sphinx_autodoc_typehints"]
source_suffix = ".rst"
master_doc = "doc"

doc.rst

Doc
###

.. automodule:: mod
    :members:

mod.py

from dataclasses import dataclass


@dataclass
class Foo:

    pass

Command used:

python3.8 -m sphinx . build

Relevant versions:

Sphinx==2.3.1
sphinx-autodoc-typehints==1.10.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions