J
Joseph L. Casale
I have an issue with some code I have been passed:
for (x, y) in [(a_dict1, a_tuple[0]), (a_dict2, a_tuple[1])]:
I only noticed it as PyCharm failed to assign the str type to y, whereas itknew
the tuples 0 and 1 item were type str.
In the loop it flags the passing of y into a method that expects type str. I can ignore
it, but looking at the loop, I cant help but think there is a better way?
Any guidance would be appreciated!
jlc
for (x, y) in [(a_dict1, a_tuple[0]), (a_dict2, a_tuple[1])]:
I only noticed it as PyCharm failed to assign the str type to y, whereas itknew
the tuples 0 and 1 item were type str.
In the loop it flags the passing of y into a method that expects type str. I can ignore
it, but looking at the loop, I cant help but think there is a better way?
Any guidance would be appreciated!
jlc