Populate Value List updated to Python 3

Seems to me that there is a wanton disregard for User Experience (UX). That the bug exists at all so long after official release (negligence) and the difficulty of getting a fix (by design).

Well to be fair. They did rewrite a lot of the UI for cross platform parity and rewrote the script editor completely as well. A lot of people have been frustrated but at least all the develops are AND and did not replace the older versions of the script editor or the software. Anyways, I’m starting to go off topic though.

Wow. Seems like I was late to the game. Yes. it is better to use isinstance for type checking in python.

See this

2 Likes

Oh? That implies the same code will work in IronPython 2? And it does :bangbang:

This version has the same source in both versions, same as what I linked to, now using isinstance(obj, gh.Kernel.Special.GH_ValueList) instead of type(obj).

PVL_2024Apr17a.gh (14.7 KB)

2 Likes

It does. Look at this section of Python’s Data model where is discusses customizing subclass checks.

Python allows a metaclass to customize how it is type checked so it is preferable to use isinstance() and issubclass() methods.

Furthemore Python 3 in Rhino is a complicated piece of engineering that ties dotnet runtime to the python 3 native runtime. We will keep improving the behaviour so old python 2 scripts can run with minimum changes.

1 Like