Skip to content

Operator constructor cleaning#1009

Open
tias wants to merge 35 commits into
masterfrom
mypy_operator
Open

Operator constructor cleaning#1009
tias wants to merge 35 commits into
masterfrom
mypy_operator

Conversation

@tias

@tias tias commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

No more flatlist, and a bit cleaner paths.

Minor efficiency improvements.

Typing is still near-impossible because wsum requires 2 ListLikes and the other take 1 ListLike

tias and others added 30 commits April 24, 2026 23:00
also deprecates the use of floats in mul
so list[Expression] was not a ListLike[ExprLike]...

because list is mutable, and mutable collections are type 'invariant';
what we want is 'covariant' behaviour which would treat Expression as
a subclass of ExprLike
https://mypy.readthedocs.io/en/stable/common_issues.html#invariance-vs-covariance

The Sequence type covers tuple and list (and others, like iterators I think)
and it is covariant, so that resolves that (and accepts other things we
also accept, because we just use generic sequence (iterate, select
element) functions on it
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