Fix mypy implicit reexport error

See original GitHub issue

If you try to import from_dict with no_implicit_reexport enabled in mypy, you get an error:

Module 'dacite' does not explicitly export attribute 'from_dict'; implicit reexport disabled

This is easily fixed by simply defining __all__ in dacite/__init__.py. I’m happy to do a PR if it helps.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
konradhalascommented, Aug 24, 2021

hi @markedwards - thank you for reporting this issue. Should be fixed in a7834ba2421f6c52be8cd0f787660940deb9fc5b

2reactions
jessestrickercommented, Jul 17, 2022

As the fix is not released on PyPI yet, here is workaround for a pyproject.toml:

# https://github.com/konradhalas/dacite/issues/133
[[tool.mypy.overrides]]
module = "dacite"
implicit_reexport = true

(adapted from @Akuli)

Read more comments on GitHub >

github_iconTop Results From Across the Web

The mypy command line - mypy 0.991 documentation
This flag reports an error whenever a class subclasses a value of type Any . This may occur when the base class is...
Read more >
mypy gives an error while importing submodule : Module has ...
I know it is correct but mypy shows this error message. I could import like this: from django.contrib import gis and use forms...
Read more >
Mypy Tips and Tricks | Justin Austin
No implicit re-export. Python allows you to import foo from file A even if file A doesn't declare foo , provided that file...
Read more >
Mypy Documentation - Read the Docs
Mypy is a static type checker for Python. Type checkers help ensure that you're using variables and functions in your code correctly.
Read more >
[PYTHON-3311] Module "pymongo" does not explicitly export ...
... export attribute "MongoClient"; implicit reexport disabled ... Type: Bug ... implicit reexport disabled [attr-defined] from mypy linter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found