Rhino 8 Script Editor Default Type Hint

Hi @eirannejad,

I just noticed that the default type hint in the new script editor (CPython and IronPython) unfortunately has been changed back from No Type Hint to ghdoc Object. We had a four year long discussion about this topic for GHPython back here:

In brief, I’d much prefer if either (in order of preference):

  1. The default type hint was No Type Hint.
  2. There was an option to set the default type hint (e.g. under Grasshopper menu).
  3. The GHPython neighbour inheritance behaviour (is clunky, but works ok).

Best,

Anders

@AndersDeleuran

  1. As far as I am aware the legacy GHPython component uses ghobject as a default hint. This screenshot is from latest Rhino 7

  1. I do not see this option either. Where is that? I can implement it in the editor

RH-82009 Allow setting default Hint for python script component

  1. What is neighbour inheritance?
1 Like

Indeed, which was the crux of the discussion in the other topic. Basically, at some point way back McNeel made a conjecture that ghdoc Object when geometry (rhinoscriptsyntax) as the default type hint would be more user/beginner friendly (i.e. because rhinoscriptsyntax). Which in my experience as a long time GHPython user/tutor has not been proven. If anything, it has proven itself to cause a lot of confusion for beginners and needlessly convoluted code (e.g. casting, dealing with GUIDs).

This does not exist, but was my proposal as a minimal solution that would satisfy everyone.

This was the solution eventually proposed/implemented by McNeel. As I said in the other topic, it’s clunky (and obviously not very well known/apparent since you don’t know about it), but does work. And again, I would much rather just be able to turn off default type hints than jump through hacky hoops :man_shrugging:

1 Like

Sounds good. I get RH-82009 implemented for the next Rhino version.

1 Like

That’s fantastic, thanks so much Ehsan :pray:

Coming up in Rhino 8.9

3 Likes

Hi Ehsan, nice to see you here!
I have been using Dynamo most of the times but recently I start working on some GH scripts. This type hint thingy certainly bothers me a lot.
I am editing scripts created by a coworker, and all those hints are set to ghdoc on my machine.


Basically, my Py3 script component does not have this “Default Python Hint” option as you showed up here.

I am on Rhino Version 8 SR12 (8.12.24282.7001, 2024-10-08)
And GH

Everything out of the box, am I missing anything here?
Thanks!

You have to hold down shift while right-clicking. Not super intuitive or Grasshoppery indeed.

2 Likes

Wow! Thanks Anders!

1 Like