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

Variable length Tuple #955

Open
MarcSkovMadsen opened this issue Jul 15, 2024 · 1 comment
Open

Variable length Tuple #955

MarcSkovMadsen opened this issue Jul 15, 2024 · 1 comment
Labels
type-feature Feature request

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Jul 15, 2024

In holoviz/panel#6912 we are trying to auto-convert Traitlets and Pydantic models to Parameterized models.

When trying to autoconvert Tuples I experience the problem that Params tuples are fixed length while Traitlets and Pydantic are not.

Panel also implements a custom Margin parameter to work around this issue.

I've also many times been hit and surpriced by this so many times at work that I've just stopped using param.Tuple as my tuples are seldom fixed length.

Please enable Tuple to be non-fixed length or provide a NonFixedLengthTuple parameter.

@MarcSkovMadsen MarcSkovMadsen added type-feature Feature request TRIAGE User-submitted issue that hasn't been triaged yet. labels Jul 15, 2024
@maximlt
Copy link
Member

maximlt commented Jul 15, 2024

I think that tuples are way more likely to have a fixed length in a code base so I get why this is the way this was originally implemented. It's a valid feature request anyway.

Params tuples are fixed length while Traitlets and Pydantic are not.

I guess that in Pydantic, that relies on Python typing, a tuple can be defined as fixed length if not defined just as tuple but e.g. as tuple[str, int, bool] which means it should contain an instance of a string, an integer and a boolean, in this order.

@philippjfr philippjfr removed the TRIAGE User-submitted issue that hasn't been triaged yet. label Jul 15, 2024
@philippjfr philippjfr modified the milestone: 2.1.0 Jul 15, 2024
@philippjfr philippjfr changed the title Varible length Tuple Variable length Tuple Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature Feature request
Projects
None yet
Development

No branches or pull requests

3 participants