Sticky variable alternative

I prefer to use the if “foo” not in globals(): method for making persistent (or “static mutable” I suppose) variables. These are also local to the individual GHPython component in which they are instantiated, simplifying things quite a lot (if you do not need them to be global across Grasshopper/Rhino).

2 Likes