Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5877

Using locals() duplicates function arguments

$
0
0

Hello here!

Here is a screenshot of the issue:

And a copy of the code:

import rhinoscriptsyntax as rs

def TestLocals(argument_A = 0, argument_B = "True"):
    argument_A = 1
    argument_B = "False"
    locals()
    return argument_A, argument_B

if __name__=="__main__":
    print "Argument value: " + str(TestLocals())

As you can see, using “locals()” function seems to duplicate both variables (argument_A & argumentB), which is infortunate since after that, I don’t know which version of the same variable is being modified and/or used. Is there a way to avoid this duplication?

Thank you!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5877

Trending Articles