Skip to content

typing with args of global functions (except multiplication, element)#910

Open
tias wants to merge 8 commits intomasterfrom
mypy_globfunc
Open

typing with args of global functions (except multiplication, element)#910
tias wants to merge 8 commits intomasterfrom
mypy_globfunc

Conversation

@tias
Copy link
Copy Markdown
Collaborator

@tias tias commented Apr 7, 2026

skipped multiplication because of a float test that needs to be rewritten first

element because I expect some hard-to-type multidim related things that might be revised in #444 anyway

@tias tias requested a review from IgnaceBleukx April 7, 2026 11:15
Copy link
Copy Markdown
Collaborator

@IgnaceBleukx IgnaceBleukx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the xxx_listlike helper functions make a lot of sense!
I suppose we'll update the .value() funcs of Operator and GlobalConstraints in future PRs in a similar style?

One blocking comment on the addition in __pow__, otherwise looks good to go

Comment thread cpmpy/expressions/core.py Outdated
Comment thread cpmpy/expressions/globalfunctions.py Outdated
Comment thread cpmpy/expressions/globalfunctions.py Outdated
@tias tias mentioned this pull request Apr 7, 2026
16 tasks
@tias
Copy link
Copy Markdown
Collaborator Author

tias commented Apr 12, 2026

I suppose we'll update the .value() funcs of Operator and GlobalConstraints in future PRs in a similar style?

Yes, for future PRs...

@tias tias requested a review from IgnaceBleukx April 21, 2026 19:18
@tias tias mentioned this pull request Apr 29, 2026
IgnaceBleukx added a commit that referenced this pull request May 6, 2026
* typing of min/max

This is a small, more specialised subset of #910 mypy_globfunc
Here we for the first time filter out the np.integers in a global,
so we don't have to account for them later...

With that, we don't need the
circular imported Expression in the typed utils
(because with int|Expression, if not int, then implicitly Expression)

* min/max: stricter typed constructor, simpler helper

* doc updates

* review comments, new npint2int

---------

Co-authored-by: Ignace Bleukx <ignace.bleukx@kuleuven.be>
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