It's not surprising your posting has taken more than a week for anyone to reply.
Here is a code sample which recreates your issue...
Code: Select all
>>> calculated = (3,4,5) << 4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported types for __lshift__: 'tuple', 'int'
It's intriguing how your code could ever create a tuple in the position of Value
at the line you highlighted. Perhaps that is what you are drawing our attention to. If that's the case, you have to INVEST TIME in reporting a bug, so that people don't assume you are just refusing to read the Python documentation...
https://docs.python.org/3/library/excep ... #TypeError
Your minimal forum posting with no detail (contra the advice at https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
) suggests that you can't be bothered to take the time to investigate bugs for yourself, and want others to do the work, which makes people very much less enthusiastic to respond.
Please reinvest time in investigating the bug for yourself. If Value
is somehow becoming magically a tuple from an int value then I'm sure people would be interested to know, but I doubt it very much. If this is the case, you should be able to create a code fragment which demonstrates the problem. Make it clear and share with us what Value
actually evaluates to (which is step 1 in any programmer responding to this bug). Probably if you invest the time in reporting, you will fix it yourself because of what you discover on the way.
Worth noting that any stray comma in code (not present in the code sample you shared), would create a tuple. So for example, this also recreates your bug and can be quite a subtle and hard-to-spot error in some cases...
Code: Select all
valueA = 0,
valueB = 1
valueC = valueA << valueB
If this was the source of your error, then I'm sorry to say that the code you posted isn't the code you ran to create the error.