I seem to have hard time getting the Python 3 component in grasshopper to identify when any give input is empty. Previously I have used IronPython and there this has worked fine. What am I missing here or is there some other way to check empty input in Python 3?
A simple example showing IronPython and Python 3 difference in handling the same code:
What type hint were you using in the CPython component screenshot above? I can’t reproduce the behaviour you’re describing with the ghdoc Object and No Type Hints in Rhino 8.17.25056.13001:
Now that I tried with different type hints, it seems that at least integer, point 3d, float and boolean type hints work differently than “no type hint” option. I didn’t try all the type hints.
@Lauri_Hautala@AndersDeleuran Looking at this right now and will update this post, however, on a quick look, the float, bool, int, and Point3d (struct) types are Value Types meaning they can not be NULL. So there is always a default value. I think that’s the bug in the Type Hints.
C# is special though since it does not allow non-nullables to be NULL. So they will adopt the default value for the type. Alternative is to use nullable types like int? but that introduces a whole set of other problems.