Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add __all__ to prepare for static type checkers and IDEs #3411

Merged
merged 11 commits into from
Apr 20, 2022

Conversation

MarcSkovMadsen
Copy link
Collaborator

This adds a __all__ to __init__.py files as required for static type checking and intellisense in VS code. C.f. microsoft/pylance-release#2572 (comment)

@codecov
Copy link

codecov bot commented Apr 16, 2022

Codecov Report

Merging #3411 (8189648) into master (b9c01ad) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 8189648 differs from pull request most recent head d2046b1. Consider uploading reports for the commit d2046b1 to get more accurate results

@@           Coverage Diff           @@
##           master    #3411   +/-   ##
=======================================
  Coverage   82.92%   82.93%           
=======================================
  Files         198      198           
  Lines       26999    27014   +15     
=======================================
+ Hits        22390    22405   +15     
  Misses       4609     4609           
Impacted Files Coverage Δ
panel/layout/__init__.py 100.00% <ø> (ø)
panel/__init__.py 100.00% <100.00%> (ø)
panel/config.py 58.92% <100.00%> (+0.11%) ⬆️
panel/depends.py 80.76% <100.00%> (+0.24%) ⬆️
panel/interact.py 74.48% <100.00%> (+0.08%) ⬆️
panel/io/__init__.py 87.50% <100.00%> (+0.83%) ⬆️
panel/links.py 87.04% <100.00%> (+0.03%) ⬆️
panel/pane/__init__.py 100.00% <100.00%> (ø)
panel/param.py 86.85% <100.00%> (+0.02%) ⬆️
panel/pipeline.py 88.77% <100.00%> (+0.02%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9c01ad...d2046b1. Read the comment docs.

@MarcSkovMadsen
Copy link
Collaborator Author

Both the __all__ and the redundant form seems to work.

it-works-type.mp4

@hoxbro
Copy link
Member

hoxbro commented Apr 17, 2022

I'm +1 on using __all__.

I would properly add __all__ directly below the imports, so it is clearly visible and not something you have to find at the end of the script.

@MarcSkovMadsen
Copy link
Collaborator Author

Releasing this PR together with the various docs PRs will be a major productivity boost for users of VS Code and similar IDEs :-)

@philippjfr
Copy link
Member

Thanks @MarcSkovMadsen!

@philippjfr philippjfr merged commit 325f471 into master Apr 20, 2022
@philippjfr philippjfr deleted the add-dunder-all branch April 20, 2022 10:23
@MarcSkovMadsen
Copy link
Collaborator Author

Thanks @philippjfr and others for supporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants