Skip to content

Explicitly re-export names from __init__ module#591

Merged
foarsitter merged 1 commit intojazzband:masterfrom
ProtixIT:explicit-reexport
Mar 22, 2024
Merged

Explicitly re-export names from __init__ module#591
foarsitter merged 1 commit intojazzband:masterfrom
ProtixIT:explicit-reexport

Conversation

@mthuurne
Copy link
Contributor

By listing names intended for export in the __all__ module-level variable, static code checkers like mypy are able to verify that importing a name from a module that itself imported it is by design rather than by accident.

As flake8 understand __all__, this also removes the need for warning suppression comments.

Both mypy and flake8 understand `__all__`, removing the need for
warning suppression comments.
@codecov
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (fe1d0c6) to head (00e52e8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #591   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files           6        6           
  Lines         772      773    +1     
=======================================
+ Hits          761      762    +1     
  Misses         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mthuurne mthuurne mentioned this pull request Mar 22, 2024
@foarsitter foarsitter merged commit d51f5c7 into jazzband:master Mar 22, 2024
@foarsitter
Copy link
Contributor

I like the gradual improvements, thanks @mthuurne

@mthuurne mthuurne deleted the explicit-reexport branch March 22, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants