I\'m getting code inspection warnings from PyCharm. I understand the logic, but I\'m not clear on the appropriate way to fix it. Say I have the following example function:
TL;DR Cast it using list()
Its late, still,
I had similar problem with some other code.
I could solve it by something similar to
def get_ydata(xdata): ydata = list(xdata ** 2) for i in range(len(ydata)): print ydata[i] return ydata
Consider the accepted answer. Comments on my answer are valid.