Skip to content

Please support static typing #376

@MarcSkovMadsen

Description

@MarcSkovMadsen

My Pain

I'm developing my applications in the VS Code editor. Furthermore I use pylint and mypy to help me create code of high quality. And google style docstring for documentation.

Param unfortunately does not work that well with that.

I've tried something like that.

class Scatter2dWithSelectionComponent(param.Parameterized):
    """The Scatter2dWithSelectionComponent enables a user to

    - provide a DataFrame of data
 
    Parameters
    ----------
    data : pd.DataFrame
        A dataframe of data to be shown and selected
    """
    data: pd.DataFrame = param.DataFrame(precedence=0.1)

But

  • VS Code cannot provide tab completion for instance.data. or help text on hover of instance.data.
  • Pylint complains for example that E1101: Instance of 'DataFrame' has no 'iloc' member (no-member) if I have a line like instance.data.iloc.

Solution

Support static type checking and enable all the help you can get in modern editors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docdocs, interactive help, auto-completion, etcstatus: discussionDiscussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.type-featureFeature request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions