Skip to content

demonstrates overload for precise typing#876

Draft
tias wants to merge 2 commits intomasterfrom
mypy_overload
Draft

demonstrates overload for precise typing#876
tias wants to merge 2 commits intomasterfrom
mypy_overload

Conversation

@tias
Copy link
Copy Markdown
Collaborator

@tias tias commented Mar 20, 2026

as follow-up to the discussion in #874

do we want this? its a lot of new syntax that was unnatural for me to read at first, but it shows that you can't nested lists

(there are 7-or-so other *args usages like this in globalconstraints)

@tias tias requested a review from IgnaceBleukx March 20, 2026 21:47
@tias tias marked this pull request as draft March 20, 2026 21:47
@IgnaceBleukx
Copy link
Copy Markdown
Collaborator

As briefly discussed offline: the core issue is here that NDVarArray is also an expression, right?
So ListLike[ExprLike] can also have nested lists because of this.

But when do we actually allow for such nesting? I can't think of any case where arbitrary nesting in the constructor is allowed... So my preference would be to fix the type of NDVarArray such that ListLike[ExprLike] always represents a flat list of expressions or constants.

I find the syntax of the overloads quite hard to parse, but maybe it's just a matter of getting used to

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