Problem with empty arguments in function call - Syntax Error: Unexpected token ','

I expect this is a very basic mistake but I can’t point it out, so I was just running some example scripts from python primer when I ran into this problem, when leaving empty optional arguments in a function call separated by commas I get an Unexpected token ‘,’ type of error pointing at the commas. Can anyone shed some light about this? or replicate the error? Its a long time since I learnt from this book but I seem to recall doing it this way and having it work all right.
Here’s a simplified example script where I’m getting this error:

import rhinoscriptsyntax as rs

someVar = rs.GetObject(“something”, , ,True)

Any help would be appreciated, I can’t seem to find a post about a similar error online, and have spent about the whole day looking into it without any success. Thanks!


Hi Nacho,

Welcome to the forum.

You should skip the commas and pass the boolean with it’s “keyword”

someVar = rs.GetObject(“something”, preselect=True)

I’m on my phone so not able to check actual arguments of GetObject method

Does this help?


It does mate, thanks for answering this fast.


1 Like