We have a metaclass based on type(QtWidgets.QWidget) – which resolves to Shiboken.ObjectType – that we've had in production dating back to PySide/Qt4 that's breaking in the versions of PySide2 that are on pypi (5.11.x). Earlier alpha versions of PySide2 (2.0.0~alpha0) do not have this problem.
If you call the following from Python 2.7 using a 5.11.x version of PySide2, you'll see that it appears as though Shiboken.ObjectType is passing through arguments it's given to type.__new__, which isn't allowed.
This line of code is contrived just to illustrate the problem, hence the empty name, parents, and class_dict arguments, and passing the type in as-is. In our production code, that would be the metaclass we're defining, and the remaining arguments would be passed through from input args/kwargs:
In PySide2 5.11.x, the following is raised:
In PySide/Qt4 or PySide2 2.0.0~alpha0, the correct return occurs:
We're unsure whether this is a bug, or if it's intentional behavior and we're simply doing something that's incorrect by today's standards. Some guidance here would be appreciated!