You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand correctly, the *Poly types use the Type Erasure pattern allowing developers to create their own implementations of the respective types that do not have to inherit from a common base class. The compiler can gather the used variants and create an appropriate overload for that specific combination.
I am curious how this would work with Python objects. Ideally, this wrapper should allow me to create a pure Python class that is compatible with a *Poly interface. However, I am not sure how this could work, as the compiler is not aware of any Python code at compile time. I guess you could force the compiler to create a variant with a PyObject as the templated variable, but I am not sure if that would break some of the checks or built-in functions on the C++ side.
How could the *Poly interfaces be supported on the Python side?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If I understand correctly, the
*Poly
types use the Type Erasure pattern allowing developers to create their own implementations of the respective types that do not have to inherit from a common base class. The compiler can gather the used variants and create an appropriate overload for that specific combination.I am curious how this would work with Python objects. Ideally, this wrapper should allow me to create a pure Python class that is compatible with a
*Poly
interface. However, I am not sure how this could work, as the compiler is not aware of any Python code at compile time. I guess you could force the compiler to create a variant with aPyObject
as the templated variable, but I am not sure if that would break some of the checks or built-in functions on the C++ side.How could the
*Poly
interfaces be supported on the Python side?Beta Was this translation helpful? Give feedback.
All reactions