Python type hints partially broken for @planning_entity classes #1265
Labels
bug
Something isn't working
process/needs triage
Requires initial assessment of validity, priority etc.
python
Is related to Python code.
Describe the bug
When using planning_entity annotated classes, their types do not properly pass through in generics, such as when using
ConstraintFactory#for_each
.Expected behavior
In the below code, the type of stream would be
UniConstraintStream[Job]
and intellisense would showx
as a valid property ofjob
Actual behavior
the type of stream would be
UniConstraintStream
and intellisense showsjob
asAny
To Reproduce
Environment
Timefold Solver Version or Git ref:
1.16.0b0
Output of
java -version
:Output of
uname -a
orver
:Additional information
@planning_entity
is annotated as follows:Shouldn't
entity_class
beTypeVar
ed, and the return just be that typevar (and not a union with callable)?NB: I'm specifically using Pylance in VS Code
The text was updated successfully, but these errors were encountered: