[Smtk-developers] Pybind and attribute::ItemDefinition subclasses

David Thompson david.thompson at kitware.com
Wed Apr 4 19:25:42 EDT 2018


Hi TJ,

While working on the great ModelEntityItem purge of 2018, I ran into an issue wrapping its replacement's definition class (ReferenceItemDefinition). It builds but running a python test like unitAttributeBasicsPy causes this failure:

  ImportError: generic_type: type "ReferenceItemDefinition" does not have a non-default holder type while its base "smtk::attribute::ItemDefinition" does

I can get it to run properly if I copy the pattern from ItemDefinition (which creates a PySharedPtrClass<T> instead of a py::class_<T, T::Superclass>)... but is this something I should know to do or is there a problem with the ReferenceItemDefinition header that causes the utilities/python/cpp_to_pybind11.py script to barf out brokenness? If the former can we document it somewhere?

	Thanks,
	David


More information about the Smtk-developers mailing list