This is very strange because python itself allows this. Also, I did it before in Dynamo, although not Revit 2021 - has anything changed or am I missing something?
Thanks for the answer. I didn’t realize the ambiguity, IN[0] is itself a list of line objects.
There is no error in my syntax actually. I have just found out that the error only occurs when I try to pass the dictionary out of the python script and into Dynamo. As long as the dictionary is only used within the script, it works fine. When I pass it out, it looks like it automatically tries to convert integer keys to strings and fails.
So is it Dynamo itself that cannot handle integer keys? Can anyone clarify?