Skip to content

Mypy error: Module "datadog" does not explicitly export attribute "statsd" [attr-defined] #842

@tuukkamustonen

Description

@tuukkamustonen
from datadog import statsd

Mypy nags:

foo.py:1: error: Module "datadog" does not explicitly export attribute "statsd"  [attr-defined]

That's because datadog.__init__ doesn't explicitly expose the module imported in its __all__ = []. See https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport.

mypy --strict enables that check, so I assume others will bump into it, too.

datadog==0.49.1
mypy=1.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug related issuestaleStale - Bot reminder

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions