Minor complaint on Python/RhinoCommon samples (developer.rhino3d.com)

I see this in many of the samples:

from Rhino import *
from Rhino.Geometry import *
from Rhino.Commands import *
from Rhino.Display import *

etc.

Unfortunately, this often does not help us easily understand what classes/methods are being used as they are no longer explicitly spelled out, especially if there are several * as above, it’s harder to find the methods in the script and to understand to which classes they belong.

Importing everything with a * is fine in common practice and makes for less typing when you know what you are doing, but explicitly laying out the whole method “chain” is far better for people trying to learn and understand what the sample is all about…

Just my opinion of course… thanks for listening!

–Mitch

1 Like

+1: There are rather significant reasons not to import using *, that it makes me wonder why it is even an option in the first place (Pythonically speaking). My primary issue being how it makes it impossible to trace back namespaces etc (especially when just looking at raw code), second that it breaks the intellisense we do have.

Hi @Helvetosaur,

Any example(s) in particular?

– Dale

There are quite a few, I run across them from time to time…
http://developer.rhino3d.com/5/api/RhinoCommonWin/html/T_Rhino_UI_MouseCallback.htm (from yesterday)

(note that this one doesn’t even exist as a sample on the current V6 site, looks like none of the RhinoCommon SDK entries have samples attached anymore)

In the samples section for V6, in a couple of minutes of random clicking I found these:

… etc. …