You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
csp.const does not resolve type of heterogeneous containers properly #316
If you have multiple typed elements in a container, we are currently only resolving the type based on the first element. This leads to incorrect behaviour.
To Reproduce
defg():
u=csp.const([1,'abc']) # resolved as typing.List[int]csp.print('u', u)
print(csp.run(g, starttime=datetime(2020,1,1), endtime=timedelta()))
Gives
TypeError: Conversions.h:fromPython<long int>:222:TypeError: Invalid int type, expected long (int) got str
Expected behavior
The code above should print [1, 'abc']
Error Message
See above
Runtime Environment
0.0.5
3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:23:07) [GCC 12.3.0]
linux
Activity