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

Incomplete/missing type annotations #7078

Open
gandhis1 opened this issue Aug 5, 2024 · 1 comment
Open

Incomplete/missing type annotations #7078

gandhis1 opened this issue Aug 5, 2024 · 1 comment

Comments

@gandhis1
Copy link
Contributor

gandhis1 commented Aug 5, 2024

A number of elements of the public interface are untyped and thus can get flagged in user code that uses strict typing. Here are just a few. I'm flagging these as it's not clear whether this is intentional - large parts of panel are annotated and these seem to just have been missed more so than a deliberate choice to not type them.

error: Untyped decorator makes function X untyped  [misc] (this was for @pn.cache)
error: Untyped decorator makes function X untyped  [misc] (this was for @pn.io.profile)
error: Call to untyped function "Button" in typed context  [no-untyped-call] (pn.widgets.Button)
error: Call to untyped function X in typed context  [no-untyped-call] (inherits from pn.widgets.Tabulator)
error: Call to untyped function "StaticText" in typed context  [no-untyped-call] (pn.widgets.StaticText)
error: Call to untyped function "Card" in typed context  [no-untyped-call] (pn.Card)
error: Call to untyped function "HSpacer" in typed context  [no-untyped-call] (pn.layout.HSpacer)
error: Call to untyped function "Number" in typed context  [no-untyped-call] (pn.indicators.Number)
error: Call to untyped function X in typed context  [no-untyped-call] (inherits from pn.viewable.Viewer)

In particular, annotations appear to be missing from a bunch of __init__ - even an Any would be better than nothing.

I've annotated tons of code in the past, including on several major OSS code bases, so happy to help out if there is interest.

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Aug 5, 2024

Help would be awesome. Type annotations makes Panel much easier to use for users.

I would recommend you try to make a smaller contribution as a start. See how its received and if anything needs to be aligned/ discussed. Then do one or more larger PRs.

I would like to be a reviewer.

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

No branches or pull requests

2 participants