Script editor indent warning error

Hi.

Using R8 ST17, scripting in python.

And I am getting this error:
inconsistent use of tabs and spaces in indentation

For this code:

	if hourly_:
		tree = gh.DataTree[object]()
        for i, sublist in enumerate(HourlyValues):
            path = gh.Kernel.Data.GH_Path(i)
            tree.AddRange(sublist, path)

        # Output the tree
        HourlyValues = tree

for the line for i, sublist in enumerate(HourlyValues):

But this is at the correct indent.
If I move it one space less indent, I don’t get the error immediately, but it comes when I run the script.
And it works in another script at the same indent, so…

FYI : The error is still there after a restart of Rhino.

Regards,

You are mixing spaces and tabs. Don’t do that. Use either spaces or tabs, but not both.

1 Like

Thanks, but that is a bit irritating.

I went over to tabs, and some of my code is in spaces, and some in tabs.

Now I have a work around, thank you, but it is irritating :frowning:

That is just how the Python language works. Refer to the language reference: 2. Lexical analysis — Python 3.9.21 documentation

1 Like

One learns, painfully, everyday.